vs 2008 c# make button visible
How do I make a button visible when pressing the "CTRL" + "F12" key? I'm running vs 2008 C#.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Feb 12, 2010, 5:03 PM
private void Form1_Load(object sender, EventArgs e)
{
this.KeyPreview = true;
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control == true && e.KeyCode == Keys.F12)
{
button1.Enabled = true;
}
}
Sam HobbsPosted Feb 14, 2010, 1:56 PM
I did not say that you copied my code; please don't misquote me. The difference between "duplicate" and "copied" is subtle but there is a difference. I said it was a duplicate. To the extent that you honestly believed that my code is wrong, I apologize for saying that yours is a duplicate.
I did not realize initially that you are using the KeyDown event, and to the extent that that is different, there is a difference in our code. Regardless, my code does do what I said it does.
Kirtan PatelPosted Feb 13, 2010, 3:53 PM
your answer is wrong and you are telling me that i have copied your answer ..?
you have mentioned KeyPress Event . and there is not (!control) in Keypress Event ...
First Learn to Give Answer Which is correct then tell others about copying ..
and i have not copied yours i have written code in KeyDown Event ..and When you not write code properly dont blame on others
Sam HobbsPosted Feb 12, 2010, 9:03 PM
Sam HobbsPosted Feb 12, 2010, 4:34 PM
If my reply helped you, then please check the "Do you like this Answer" checkbox.