Child Form not refreshing when i try to start the app from MDI form?

I have MDI form and child forms in my app. Here my situation...

Main Form : MDI Form Register Form : Child of MDI form Desig form : another form which will open when we will click one button on Register form.

now if i try to refresh the items of combo box of Register form from Desig form, then it is not refreshing. i.e. i can't see my new items in that combo box on Register form.

Now when i try to start my app directly from Register form then the same code works perfectly but same code is not running when i try to start the app from MDI form.

here is my codes. MDI Form :

Dim regform As New Register
StatusLabel.Text = "Opening Workman Registration"
regform.MdiParent = Me
regform.Show()
StatusLabel.Text = "Workman Registration"
regform.concombo.Focus()

Register form:

 Public Sub refreshCombo()
    desigcombo.Items.Clear()
    sitecombo.Items.Clear()

    addDesCombo() ' method which will loads all new data from database 

    desigcombo.Text = designame ' the string variable (designame)


End Sub

Desig Form

Register.refreshCombo() ' will run when we will click on one button.

so is their any thing which need to remember when we using MDI form - Child Form?

Answers


When you refresh Register from Desig, it works when you start the app from Register because there is only one Register form and VB automatically considers it an instance of the form.

When the register form is a child form, you need to use the instance of the form rather than the class name, something like MainForm.ActiveMdiChild.refreshCombo()


Need Your Help

Using a Picture Box as a button, how do I ignore/disable double-click events?

c# winforms visual-studio-2008 object windows-ce

I'm having some difficulty using picture boxes as buttons. I'd like to have custom button graphics rather than using the plain-old windows forms Button control.

NSString into NSData

cocoa nsstring nsdata

I wanna have a NSString object as NSData. Later this NSData-Object should return his stringValue with: