Results 1 to 3 of 3

Thread: Creating a toolbar

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145
    Hello!
    I'd like to create a toolbar in my app, for the most common choices, such as New file, Save file, Open file, Print, Cut, Copy, Paste and so on (I'm working on a texteditor/encryptor).
    I guess I could put in a lot of small pictures, but there should be an easier way o do it.

    If anyone know how to create it, please help me!

    Thanks,
    Pentax
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

  2. #2
    Lively Member
    Join Date
    Mar 2000
    Location
    Germany
    Posts
    84
    Hi,

    what you need to do is:

    1) add the Component Windows Common Controls to you project, it contains a toolbar

    2) drag a toolbar and an imagelist to your form

    3) add icons to the imagelist

    4) in the Button-Tab of the Toolbar, set the buttons you want to have, give each button a key

    5) add the code

    Code:
    Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
       Select Case Button.Key
          Case "Key1" 'key for button1
             'add code you want to run
          
          Case "Key2"
             '...
             
       End Select
    End Sub
    Hope this helps

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145

    Thankyou

    Thanks a lot!
    I'll try it (when I've got time over from History, French, Math, Physics, German, Chemistry and other stuff).
    *Sigh*

    Pentax
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

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