|
-
Oct 16th, 2000, 01:05 AM
#1
Thread Starter
Lively Member
How can I disable the "Enter" key in a
multi-line text box?
Thanks.
0101011001000010
01101111011011100110110001101001011011100110010101110010
-
Oct 16th, 2000, 02:15 AM
#2
transcendental analytic
Code:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then KeyCode = 0
End Sub
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 16th, 2000, 02:17 AM
#3
Thread Starter
Lively Member
Disable the "Enter" Key.
The KeyDown event is not working with
the "Enter" key!!!
Any suggestions?
Thanks
[Edited by VBonliner on 10-16-2000 at 03:58 AM]
0101011001000010
01101111011011100110110001101001011011100110010101110010
-
Oct 16th, 2000, 03:02 AM
#4
Thread Starter
Lively Member
Problem with KeyDown event and the "Enter" Key.
0101011001000010
01101111011011100110110001101001011011100110010101110010
-
Oct 16th, 2000, 06:35 AM
#5
Use the KeyPress event.
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then KeyAscii = 0
End Sub
-
Oct 16th, 2000, 07:20 AM
#6
Thread Starter
Lively Member
Thanks!
Thanks Matthew. It worked.
[Edited by VBonliner on 10-16-2000 at 08:25 AM]
0101011001000010
01101111011011100110110001101001011011100110010101110010
-
Oct 16th, 2000, 03:18 PM
#7
Likewise, Kedaman's method of using 13 (as opposed to vbKeyReturn) would work as well.
-
Oct 16th, 2000, 03:53 PM
#8
_______
<?>
...the difference being kedaman's code calls the default sound while Matthew's code doesn't.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Oct 16th, 2000, 04:13 PM
#9
The code that kedaman gave for KeyCode did not seem to work.
But 13 and vbKeyReturn are the same thing.
So this:
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then KeyAscii = 0
End Sub
would be the same as this:
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then KeyAscii = 0
End Sub
But it does not work in the KeyCode event.
Just a little mistake by kedaman, we aren't all perfect . I make mistakes all the time, do I care? A little, but oh well, this is vb-world, a little edit/delete post can change everything .
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
|