Toolstrip buttons

rbulph

Junior Contributor
Joined
Feb 17, 2003
Messages
397
How can I go about preventing the toolstrip buttons from getting focus when the mouse is moved over them? I want to have a group of butttons where only one can be checked at a time. If one is checked then I don't want to see the focus button on any other button as this looks exactly the same as the visual indication that a button is checked, so is confusing.

Am using the Express Beta 2005 version. Haven't used the older versions of .net, so maybe the Toolstrip is new to this, I don't know.
 
I wouldn't see this as a problem as the cursor probably doesn't spend that much time over the buttons, and since this is the normal behavior anyways, I don't see that really confusing anyone.
 
Will setting the button style property to ToggleButton be what you're looking for? This will leave the clicked button in a detent position and thus visually differentiate it from the others.
 
There doesn't seem to be a style or button style property, only CheckOnClick which is what I'm using at the moment to allow a button to be selected. Would still like to fix this if I can. Maybe I should subclass the non-selected buttons and stop them being repainted.
 
Are we talking about the ToolBar Buttons as there is a button style properity. After selecting the tool bar in designer mode, select the Buttons Collection properity. Then find Style under the Misc. section and select ToggleButton. You'll then use the e.Button.Pushed method to find the selected tool bar button.
 
DiverDan said:
Are we talking about the ToolBar Buttons
.Net 2005 contains a toolstrip button. As far as I understand it is a glorified, MS Office style toolbar.
 
I personally would prefer a cheesy VS control in a lot of situations. You don't have to pay extra for it; it comes with VS. It also doesn't require additional dlls to be distributed with your app (I am still a big fan of single-file application that don't require any deployment projects or additional files).
 
Yes, I rather agree. If I go and buy another control, I've got to learn how to use that and then worry about distributing it and everything. It seems it's quite easy to owner draw controls in .net through the Paint event, so I may do that.
 
PlausiblyDamp said:
Could you clarify what you mean by Which kind of buttons are you using and how are you displaying the checked / unchecked state currently?
I'm using System.Windows.Forms.ToolStripButtons and setting the CheckOnClick property to True so that when they are pressed they become checked and this is displayed automatically. I'm using Windows Classic display style for my computer.
 
Back
Top