|
-
Apr 30th, 2003, 04:06 PM
#1
Thread Starter
Sleep mode
Multiline + Keypress event ?
When I set any textbox to multiline as true , and I use keypress event(I used here Enter key) to move to next control , all the text I wrote there go away , that's only happens while multiline property is on !
-
May 1st, 2003, 01:47 AM
#2
Fanatic Member
Not sure what you did, but this is what I did (and it works fine):
Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles TextBox1.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Enter) Then
Me.SelectNextControl(TextBox1, True, True, False, True)
End If
End Sub
-
May 1st, 2003, 12:28 PM
#3
Thread Starter
Sleep mode
No , the problem is still there . I have multiple textboxes in panel, when I used your code , it moves focus to outside the panel to commandbutton . anyways , it's not a big deal . I reset those textboxes to onelined .
-
May 1st, 2003, 12:32 PM
#4
Thread Starter
Sleep mode
Just wondering if this sort of new bug ?
-
May 1st, 2003, 03:42 PM
#5
Fanatic Member
I don't see why you're having this problem, the below works for me whether in a panel or out of one:
Code:
Private Sub TextBox1_KeyPress(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles TextBox1.KeyPress, TextBox2.KeyPress, TextBox3.KeyPress, _
TextBox4.KeyPress, TextBox5.KeyPress, TextBox6.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Enter) Then
Me.SelectNextControl(sender, True, True, True, True)
End If
End Sub
Note that for forms with nested controls (e.g. in a panel) you need to set that parameter to True...
-
May 1st, 2003, 06:42 PM
#6
Thread Starter
Sleep mode
Never mind , I firgured it out myself . thanx for the reply though !
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
|