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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kirtan PatelRank #292 · 8.6K reputationPosted Feb 12, 2010, 12:03 PM EST
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 HobbsRank #107 · 20.5K reputationPosted Feb 12, 2010, 11:34 AM EST
If my reply helped you, then please check the "Do you like this Answer" checkbox.
Sam HobbsRank #107 · 20.5K reputationPosted Feb 12, 2010, 4:03 PM EST
Kirtan PatelRank #292 · 8.6K reputationPosted Feb 13, 2010, 10:53 AM EST
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 HobbsRank #107 · 20.5K reputationPosted Feb 14, 2010, 8:56 AM EST
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.