label problem
-
hey guys,.. i am doing my mini project in c# windows form application .. in that i used a label l in form.when l.Text= "&"; its not showing anything on form inplace of label. Can anyone knows solution for it??
You can try a couple of things. (Note: I haven't tried them to make sure they all work. I just thought I'd throw out the ideas for you.)
a.Text = @"&";
a.Text = "\&";
a.Text = "& # 3 8;"; // Don't put the spaces between the characters. I just did that because otherwise you would just see the & and not the &# 38;";
a.Text = &I wasn't, now I am, then I won't be anymore.
-
hey guys,.. i am doing my mini project in c# windows form application .. in that i used a label l in form.when l.Text= "&"; its not showing anything on form inplace of label. Can anyone knows solution for it??
-
Strange. I copy/pasted your code bit. And MessageBox displays the '&'. What version of Windows, maybe?
djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.
-
You can try a couple of things. (Note: I haven't tried them to make sure they all work. I just thought I'd throw out the ideas for you.)
a.Text = @"&";
a.Text = "\&";
a.Text = "& # 3 8;"; // Don't put the spaces between the characters. I just did that because otherwise you would just see the & and not the &# 38;";
a.Text = &I wasn't, now I am, then I won't be anymore.
-
sorry, my fault.. actually i have asked wrong question.. i have updated my question.. can u pls answer for it.. ?? thank u
Oh, that is because the & symbol, when used in text on certain controls (i.e. buttons, menus, labels), the following character has a Mnemonic beneath it. In the designer (or in code), set the "UseMnemonic" property of the label control to 'false'.
djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.
-
Oh, that is because the & symbol, when used in text on certain controls (i.e. buttons, menus, labels), the following character has a Mnemonic beneath it. In the designer (or in code), set the "UseMnemonic" property of the label control to 'false'.
djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.
-
Oh, that is because the & symbol, when used in text on certain controls (i.e. buttons, menus, labels), the following character has a Mnemonic beneath it. In the designer (or in code), set the "UseMnemonic" property of the label control to 'false'.
djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.
-
And, I think, just putting it in as && will make it show up.
No dogs or cats are in the classroom. My Mu[sic] My Films My Windows Programs, etc.
I think the && would, too, thanks for adding the idea. It seems like it wouldn't matter in this case but if he is actually using the mnemonics in the application it would add the line beneath the '&' that is printed on the control. Not sure if it would be a problem but it is possible.
djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.
-
thnk u.. its working now.. :) :) can u tell me other text exmples which have this mnemonic beneath??
Anything which can take focus from an Alt+X keystroke. That is buttons, labels, menus and menu items, radio and check box buttons, groups (I think), toolbar equivalents and possibly also grid view inner control equivalents (not sure about that), off the top of my head.