CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: RestoreToolbat

  1. #1
    Join Date
    Sep 2001
    Posts
    5

    RestoreToolbat

    I have just added that facility to customise the toolbar in my program using the SaveToolbar and RestoreToolbar commands. I have added the RestoreToolbar command in Load_Form and nothing happens, If, however, I call RestoreToolbar by say clicking on a button it works. I have tried putting it in seperate functions and calling it from Form_Load but can't get it to work. I suspect it is because RestoreToolbar will not work until the Form_Load event has finished. Any ideas?

    Ian Bennett


  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: RestoreToolbat

    Try using the Form_Activate event instead. At Form_load time, the Form is not yet built.

    John G

  3. #3
    Join Date
    Sep 2001
    Posts
    5

    Re: RestoreToolbat

    I tried that but to no avail. Is there a post Form_Load event?


  4. #4
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: RestoreToolbat

    The form_Activate event is invoked any time the form is shown. It is "Post" _Load and after all controls and the form are completely created and ready to run.
    If you put a Form.Show in the Form_Load event, all the functions available to you at run time should be available after the .Show

    John G

  5. #5
    Join Date
    Sep 2001
    Posts
    5

    Re: RestoreToolbat

    Hi John,

    It was late and my brain was not really in gear. I have managed to crack the problem by doing a toolbar.refresh BEFORE a toolbar.restore! I initially did a refresh after the restore but it did not work. Still.... that is VB for you.
    Thanks for your help.


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

Featured