Results 1 to 7 of 7

Thread: toolbar save button

  1. #1

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539

    toolbar save button

    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
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  2. #2
    Lively Member
    Join Date
    Oct 2003
    Posts
    88
    for example...
    VB Code:
    1. Private Sub tbarMain_ButtonClick(ByVal sender As System.Object, _
    2.     ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) _
    3.     Handles tbarMain.ButtonClick
    4.         Select Case tbarMain.Buttons.IndexOf(e.Button)
    5.             Case 0
    6.                 'New character
    7.                 DoFileNew()
    8.  
    9.             Case 1
    10.                 'Open character
    11.                 DoFileOpen()
    12.  
    13.             Case 2
    14.                 'Save Character
    15.                 DoFileSave()
    16.  
    17.             Case 4
    18.                 'Print
    19.                 BuildAllPrintRichTexts()
    20.                 DoPrintAll()
    21.             Case 6
    22.                 'Select Genre
    23.                 DoSelectGenre()
    24.  
    25.             Case 7
    26.                 'Options
    27.                 DoProgramOptions()
    28.  
    29.             Case 8
    30.                 'Show Background
    31.                 DoShowBackground()
    32.  
    33.             Case 10
    34.                 'Show Bonuses
    35.                 DoShowBonuses()
    36.  
    37.             Case 12
    38.                 'View All in a selection listview
    39.                 mnuViewAll.Checked = True
    40.                 mnuViewSelected.Checked = False
    41.                 DoListViewViewAll()
    42.  
    43.             Case 13
    44.                 'View Selected in a selection listview
    45.                 mnuViewAll.Checked = False
    46.                 mnuViewSelected.Checked = True
    47.                 DoListViewViewSelected()
    48.  
    49.             Case 15
    50.                 'Show Spell Counters
    51.                 DoShowCounters()
    52.  
    53.         End Select

  3. #3

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539
    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
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  4. #4
    Lively Member
    Join Date
    Oct 2003
    Posts
    88
    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...)

  5. #5

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539
    yes i am using mdi forms and ive manage yo sort it coding is complicated so wont go into detail
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  6. #6
    Lively Member
    Join Date
    Oct 2003
    Posts
    88
    uh... so are you fixed up or what?

  7. #7

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539
    yes kinda just having troble accessing child forms
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width