Hey all,
How would you make the toolbar button "save" run a db insert, update, delete etc command on any child mdi form ?
cheers all
Printable View
Hey all,
How would you make the toolbar button "save" run a db insert, update, delete etc command on any child mdi form ?
cheers all
for example...
VB Code:
Private Sub tbarMain_ButtonClick(ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) _ Handles tbarMain.ButtonClick Select Case tbarMain.Buttons.IndexOf(e.Button) Case 0 'New character DoFileNew() Case 1 'Open character DoFileOpen() Case 2 'Save Character DoFileSave() Case 4 BuildAllPrintRichTexts() DoPrintAll() Case 6 'Select Genre DoSelectGenre() Case 7 'Options DoProgramOptions() Case 8 'Show Background DoShowBackground() Case 10 'Show Bonuses DoShowBonuses() Case 12 'View All in a selection listview mnuViewAll.Checked = True mnuViewSelected.Checked = False DoListViewViewAll() Case 13 'View Selected in a selection listview mnuViewAll.Checked = False mnuViewSelected.Checked = True DoListViewViewSelected() Case 15 'Show Spell Counters DoShowCounters() End Select
OK that handles the clicks, already can do that but what i mean is OK my toolbar has a button SAVE with image of disk on it,
handle the click action and call a function called "DoSave()" ok so this is the problem i have about 10 forms with data being inputted and on each form is a text button saying SAVE if you click the text button it saves the data but i want my users to be able to click a save button on the toolbar and it will save the data on any page that is the active child
cheers Carl
Well then, write code to do so. Are you using an MDI form or multiple instances of the same form or what? If you are using MDI and want to determine the currently active child window:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/vbcon/html/vbtskdeterminingactivemdichild.htm
(if you have a different version of help just paste in from /vbcon forward in front of any help page) (wish MS hadn't changed the format of help urls...)
yes i am using mdi forms and ive manage yo sort it coding is complicated so wont go into detail
uh... so are you fixed up or what?
yes kinda just having troble accessing child forms