I have made an application in which there are two textboxes such that as I am writing in first textbox ,it automatically appears in second textbox.
Like for enter key we can apply any functionality on enter key press event ...
Is the same thing possible for spacebar key too......
Can anyone help me in this.............
avirag
10
Posting Whiz
Recommended Answers
Jump to Postyou can apply code on key press event............
Jump to PostYa well , it can works for all keys, i just want for space key.....
Add a KeyDown event:
private void textBox_KeyDown(object sender, KeyEventArgs e) { if (Control.ModifierKeys == Keys.Space) ;//spacebar was pressed }
Jump to PostAdd a KeyDown event:
private void textBox_KeyDown(object sender, KeyEventArgs e) { if (Control.ModifierKeys == Keys.Space) ;//spacebar was pressed }
Sorry, I just realized I compared apples to oranges somewhat.... Try this instead:
private void textBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) ;//spacebar was …
All 10 Replies
VibhorG
0
Junior Poster in Training
avirag
10
Posting Whiz
DdoubleD
315
Posting Shark
ddanbe
2,724
Professional Procrastinator
Featured Poster
DdoubleD
315
Posting Shark
avirag
10
Posting Whiz
ayeshawzd
commented:
plz add me
+0
ayeshawzd
0
Newbie Poster
avirag
10
Posting Whiz
ayeshawzd
0
Newbie Poster
avirag
10
Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.