It is unclear if the MainForm and the ManageAccounts forms are MDIChildren of the main application form or there is some other relation between them. It does appear that the "ManageAccounts" form is launched from the "MainForm". If so, I do not see why you would create a new instance of "MainForm". You should be accessing the open instance of the Mainform and adding items to the ComboBox present on that form.
On Jun 18, 8:37 pm, "[email protected]" <[email protected]> wrote: > Hi all, > > I am currently developing a c# application. I have two forms. the > first form is called mainScreen with a combo box that gets populated > at startup with data from a mysql database which works fine. > > The second form is called manageAccounts. > > The user is able to add a bank account into the manage accounts form > which is submitted into the database. After it has gone into the > database I want the program to add this item into the combo box that > is on MainScreen. > > To do this within the manageAccounts from I am doing this: > > mainScreen dlg = new mainScreen(); > dlg.comboBox.Items.add("My New Bank"); > > When I debug it seems to add the item to the combo but it is not > actually shown in the combo box, i.e. the only records within the > combo box are the records it retrieved from the mysql database when it > first launched and not the new item i am trying to add manually to the > combo. > > Any help in this matter would be highly appreciated. > > Thank you
