ToniMontana Posted April 5, 2004 Posted April 5, 2004 Hi all, how can I realize the usage of function keys in my win forms application, so that I can Show or Hide different panels, which all have different buttons. But these buttons should all be pressed by the usage of the function keys. Quote Greetings, Toni.
Arch4ngel Posted April 5, 2004 Posted April 5, 2004 You can add a & in the Text of your control. And when you do ALT+(A LETTER). This control OnClick(in most case) will be called. N.B.: (A LETTER) is the letter that is right after the &. The letter become the new function key. It support 2 with the same letter but only one will be called. Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
TechnoTone Posted April 5, 2004 Posted April 5, 2004 Turn on the forms KeyPreview property and respond to its KeyPressed event. When a function key is pressed you can show the correct panel (and hide the others). Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
Arch4ngel Posted April 5, 2004 Posted April 5, 2004 Yeah... but try not to make this function over charged. Since it's called everytime a key is pressed... don't make cpu consumming functions in this section. Everything else was said by the... flashing (your picture) TechnoTone Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Moderators Robby Posted April 5, 2004 Moderators Posted April 5, 2004 Arch4ngel, I don't think there's a difference between a Ctrl key calling a function or a Button calling the same function, visa vie "don't make cpu consumming functions in this section" Quote Visit...Bassic Software
Arch4ngel Posted April 5, 2004 Posted April 5, 2004 I mean by that : private void FormKeyPress( object sender, KeyPressEventArgs e ) { CpuConsummingProcedure(); } Wouldn't be very long if you are typing a text ? That what I was meaning. But if you can explain me why it shouldn't be cpu consumming... I'll be happy (unless by putting it in a condition). Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Administrators PlausiblyDamp Posted April 5, 2004 Administrators Posted April 5, 2004 Arch4ngel, in ToniMontana's original post he said so that I can Show or Hide different panels unless you know something special about the .Net framework I hardly think these activities count as cpu consumming functions Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Moderators Robby Posted April 5, 2004 Moderators Posted April 5, 2004 That what I was meaning. But if you can explain me why it shouldn't be cpu consumming.. I said it shouldn't make any difference. Quote Visit...Bassic Software
Arch4ngel Posted April 5, 2004 Posted April 5, 2004 Hehe lolllll okay let's not start a war about that :D ;) Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.