|
-
May 17th, 2003, 11:23 AM
#1
no compile error, but these events do not launch
pragash, may you help?
[SOURCE]
private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
MessageBox.Show("char:"+e.KeyData,"you pressed a keydown",MessageBoxButtons.OK,MessageBoxIcon.Information);
/*what happened?
if(e.Alt)
alt_label.Enabled = true;
if(e.Control)
ctrl_label.Enabled = true;
//display_textbox.Text += e.KeyCode;
*/
MessageBox.Show("keydata:" + e.KeyData,"data",MessageBoxButtons.OK,MessageBoxIcon.Hand);
}
[/SOURCE]
[SOURCE]
private void Form1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
MessageBox.Show("char:" + e.KeyChar,"you pressed a button",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
private void Form1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
MessageBox.Show("x","x",MessageBoxButtons.OK,MessageBoxIcon.Hand);
}
[/SOURCE]
end------------------------------
Programmers aren't born, but are made from hardwork, effort and time.
To be a good one, requires more effort and hardwork.
Therefore N quality programmer = (N*hardwork)+(N*effort)+(N*time)
-
May 17th, 2003, 01:15 PM
#2
Looks like you made the userdefined events, but did you add them to make sure they are used?
something like:
Code:
this.menuItemNormal.Click += new System.EventHandler(this.menuItemNormal_Click);
-
May 18th, 2003, 11:55 PM
#3
managed to solve the problem, the event handler is bind to the form, therefore I need to enable the KeyPreview property inorder for the form to capture the event which I clearly did not. Therefore the event handler do not launch. Sorry for any mis-communication.
end------------------------------
Programmers aren't born, but are made from hardwork, effort and time.
To be a good one, requires more effort and hardwork.
Therefore N quality programmer = (N*hardwork)+(N*effort)+(N*time)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|