Create OWN Toolbar in VB

Posted on 2003-03-15
Medium Priority
Last Modified: 2010-04-07
I want to create a own tool bar with facility of image or color changing when  mouse over the buttons in that toolbar
Question by:mullaiprince

Accepted Solution

TrueIdiot earned 200 total points
ID: 8143596
I don't know what VB you're running, but if you can use the toolbar control(I know this works in VB5 and up, don't know about the rest), then here's how:

1) open your VB project
2) right click on your toolbox
3) select "components"
4) making sure the "controls" tab at the top is selected,
     scroll down the list (it's pretty long) until you
     find "Windows Common Controls 5.0 (SP2)"
     Note: your version of VB might have something
      different after the words "Common Controls," but
      those don't matter
5) you should now see a "Toolbar" control in your toolbox
6) add a toolbar to your project
7) to use icons in your toolbar, add a icon list control
8) right click the toolbar control (on your project) and
   select "Properties"
9) select the buttons tab and add buttons galore (I found
    this screen pretty self-explainatory, but I'll be back
    if you need more help)
    Note: the "Image" property refers to the index of
     icons in your icon list (use the properties dialog to
     edit these too)
10) in the code editor window select your toolbar from the
    left dropdown menu and MouseMove from the right menu
11) that procedure will excecute whenever the mouse passes
      over the toolbar.

Here's what VB's help said about the arguments

     An integer that corresponds to the state of the mouse buttons in which a bit is set if the button is down. The button argument is a bit field with bits corresponding to the left button (bit 0), right button (bit 1), and middle button (bit 2). These bits correspond to the values 1, 2, and 4, respectively. It indicates the complete state of the mouse buttons; some, all, or none of these three bits can be set, indicating that some, all, or none of the buttons are pressed.

     An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys. A bit is set if the key is down. The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2 ). These bits correspond to the values 1, 2, and 4, respectively. The shift argument indicates the state of these keys. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT were pressed, the value of shift would be 6.
x, y:
     A number that specifies the current location of the mouse pointer. The x and y values are always expressed in terms of the coordinate system set by the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties of the object.

Expert Comment

ID: 8900044
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
LVL 49

Expert Comment

ID: 9699791
Moderator, my recommended disposition is:

    Accept TrueIdiot's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question