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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlight Toolbar option? 1

Status
Not open for further replies.

Dalain

Technical User
Jan 10, 2003
104
CA
I’m trying to highlight a button on a toolbar using VB based on information on a form.

This would be similar to how the Justification (Left/Center/Right) on the formatting tool bar works, when a field is selected. I have tried SetFocus, but this does not work as it moves the focus to the button and once the user goes back to the field, the button is no longer highlighted.

Also Enabled is not good ether as the button must always be enabled.

Does anyone have any ideas?

Code:
   CommandBars ("EditView").Controls(11).????
 
How are ya Dalain . . .

Have a look at the [blue]State[/blue] property of a commandbar button.

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Doing well, thanks AceMan.

Good idea, but when I tried it, it didn't work. There was no error code, just not highlighted. Do you have to update it after for it to work?





 
It’s OK now, I got it to work.

Code:
 CommandBars("EditView").Controls(11).State = True

I had to move a button that was capable of changing states, like the justification ones, to my custom ToolBar . Then I changed the Button Image and the On Action code. Now it works.

It seems that only certain buttons are capable of this.

Thanks, and here is a star.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top