Questions and Answers on any aspect of .NET. Now closed.
Besides querying the Text property, how do you find out which button on the toolbar has been clicked? The Name property doesn't appear in the code window, but only appears in the design mode.
The problem is that I have added a lot of spaces to the left of the label of one of my buttons. The actual label text I have entered in the design mode is " Exit Map".
When I query this:
else if (e.Button.Text.Trim() == "Exit Map")
The code skips this condition altogether. For the other labels, it enters the construct as it should. I am a bit confused.
I had to resolve the same problem, finding out, which button was clicked. I used the ImageIndex for identification. Not very elegant either, I guess, but it will save you trouble if you ever have to make a version of your software in another language and the GUI strings change.
I don't know why your condition does not work. Maybe you have a hidden character which does not count as whitespace? Carriage return oder the like?
Tuesday, July 18, 2006
This topic is archived. No further replies will be accepted.Other recent topics
Powered by FogBugz