Refresh ComboBox RRS feed

  • Question

  • Hi
        I am new to VB.NET. In my project i am having one parent form and one child form. In Parent form i am having one combo box load data from Database. And in child form i having one text box and one button. In Child Form i am Enter the value in text box. Then click the Button it will stored to the Database and the current enter value is to loaded into the combo box in the parent form without reload the form. One thing is both form are opened simultaneously.How to do that?
    Saturday, May 31, 2008 3:54 AM


  • well simply open the child form in a modal form, then after they close that child form, rebind the data from the database on the parent form. Example:

    'parent form code

    Dim myChildForm as new Form2()

    if myChildForm.ShowDialog() = DialogResult.OK then

       Me.DoBindData() 'method which binds data to the combobox

    end if

    'child form code on the close button

    Me.DialogResult = DialogResult.OK

    thats it. :)
    Need 2 be back @ MS - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
    Saturday, May 31, 2008 5:36 PM