?
Solved

Create OWN Toolbar in VB

Posted on 2003-03-15
4
Medium Priority
?
431 Views
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
0
Comment
Question by:mullaiprince
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Accepted Solution

by:
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

button:
     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.

shift:
     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.
0
 

Expert Comment

by:CleanupPing
ID: 8900044
mullaiprince:
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?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 9699791
Moderator, my recommended disposition is:

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

DanRollins -- EE database cleanup volunteer
0

Featured Post

Independent Software Vendors: 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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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

770 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