Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting focus to a toolbar

Status
Not open for further replies.

dvannoy

MIS
Joined
May 4, 2001
Messages
2,765
Location
US
I have a toolbar on my main form(mdi form) once the form opens how can I set focus to the toolbar? I tryed setting the tab index of the tool bar to 0 but that wont work. the reason for this is, once the app starts and there at the main menu, i have tool tip text on each button in the toolbar. but for some reason it will not show unless one of the buttons gets clicked.


Thanks
 
For your first question: To activate a toolbar item you need to use SendKeys: SendKeys "%{S}{P}" - where in this case S and P are the underlined access keys that you would use in conjunction with the Alt (%) key.

A tooltip is not activated by a click, but from the mouse cursor being positioned over the element.
 
Thanks for your response but it still does not work.

I know a tooltip is activated by a cursor moving over an item, but this is not the case with the toolbar. it seems like the only way the tooltip text will show is if the toolbar so hows has focus. other wise I can move the cursor over the toolbar all day long and no tooltips will show.

I am using an image list with my toolbar. my tooltip text is set in the properties of the toolbar. I dont know maybe this is a VB Bug.
 
Ok, first of all I mis-spoke. When I mentioned SendKeys I was talking about the Menu and not the toolbar.
Second, I believe you cannot set the focus to the toolbar.
Third, You need to set the property "ShowTips" to True in the property window (write protected at run-time).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top