Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • Leaders
Posted
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.
[sIGPIC]e[/sIGPIC]
  • *Experts*
Posted
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.

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Posted
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.
  • *Experts*
Posted
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.

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

  • Leaders
Posted
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).
[sIGPIC]e[/sIGPIC]
Posted
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.
Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...