Problem of press the key

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi all,<br/>
<br/>
I have got a problem with the source code. When I launching the program by running through the debug, I pressed the key as "1" on my keyboard, the messagebox did not displayed.
<br/>

<div style="color:Black;background-color:White; <pre>
System::Void Form1::Form1_KeyUp(System::Object ^sender, System::Windows::Forms::KeyEventArgs ^e)
{
<span style="color:Blue; switch (e->KeyCode)
{
<span style="color:Blue; case Keys::D1:
<span style="color:Blue; if (Label1->Visible == <span style="color:Blue; false)
{
MessageBox(<span style="color:#A31515; "you have pressed the key!");
}
}
}
[/code]
<br/>
Whatever happens is when I run through on the debug, I pressed the "1" on the keyboard and nothing have happens. Do you know why the messagebox did not display when I press the "1" on the keyboard?

<span id="x__ctl0_MainContent_PostFlatView <span>Any help on this would be greatly appreciated.
Thanks,<br/>
Mark

View the full article
 
Back
Top