4

Is there a way to prevent a tool strip drop down button from being selected (without disabling it)?

I see it has a property called CanSelect, but it's read-only.

As for my second question related to this control:

Is there a way to hide the drop down symbol (black rectangle pointing down) of a tool strip drop down button?

I want to prevent it from being selected and to hide the drop down symbol to make the button act like a status strip icon next to the status label. If you can give suggestions on this, it would be much appreciated.


I didn't realise that the tool strip status label allows for images... That way I do not need to fake it with the control. Thank you all.

IneedHelp
  • 1,630
  • 1
  • 27
  • 58

3 Answers3

3

Question: Is there a way to hide the drop down symbol (black rectangle pointing down) of a tool strip drop down button?

paste the code in form constructor.

toolStripDropDownButton1.ShowDropDownArrow = false;
YOusaFZai
  • 698
  • 5
  • 21
  • You're right. I somehow missed that property of the tool strip drop down button. Thank you. +1 for now, I will check the answers the other users provided as well. – IneedHelp Sep 05 '12 at 14:36
  • thank you for now and trying to found answer for the first question other than of disabling it. – YOusaFZai Sep 05 '12 at 14:44
0

A little trickier but try to overlaying it with some control over it with opacity almost but not equal to 0.

Erre Efe
  • 15,387
  • 10
  • 45
  • 77
  • I've thought of that already, but I'd rather seek for a more elegant solution. As for the other issue, maybe I can find a way to make the `CanSelect` property writeable and set it to `false` or something. – IneedHelp Sep 02 '12 at 19:58
  • @IneedHelp Are you using WPF? – Erre Efe Sep 02 '12 at 20:06
0

I think the problem is that you are trying to use the wrong controls for what your trying to convey to your user.

Button: If a button is not meant to be interacted with you should disable it, that is the common metaphor in software. What you want to do in the way of styling is your prerogative. Alternatively you could just handle the focus and do nothing. However if your click does nothing and the button is not disabled your users will be confused.

DropDownButton: It seems like what your trying to do here is programmatic control what button action is available to the user, but do not want to let them change what action they can initiate. If that is the case, you should consider having multiple buttons here that are hidden with the exception of the one you want shown at the time. This will give the user a clear expectation of the behavior.

Obviously I'm making some assumptions here but in order to give a more detailed response I would need more details about the specific reason you want to do this to understand why you are approaching it this way.

Gent
  • 2,675
  • 1
  • 24
  • 34
  • Hello and thank you for your answer. As I mentioned in my post, I want `to make the button act like a status strip icon next to the status label`. When designing the interface, if you add a status strip it offers some controls to host, one of them is the `drop down button`. This button allows the use of images in the tool strip and I intend to use it as a tool strip icon to the far left, right before a tool strip label. It is meant to offer a visual indicator for the status. I consider that using this tool strip control is the easiest way to integrate a tool strip status icon. – IneedHelp Sep 05 '12 at 14:48