By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,705 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,705 IT Pros & Developers. It's quick & easy.

keypress for vbkeyspace

P: n/a
if keyascii = 32 then
text0 = text0 & " "
text0.selstart = len(text0)
end if

This does exactly what it needs to do when a breakpoint is added
inside the if. Without the breakpoint the keypress does not work
properly. Why would this be and how can it be rectified?

seeker53
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You haven't said whether this is on the keypress event of Text0, or some
other control.
My guess (in a vague, general way) is that this keypress is also causing
some other actions.
When you stop the code with your breakpoint, those other actions happen
first, then you execute your code and get the result you wanted.
If you don't stop the code, the other actions happen after yours, so you see
their effects, not yours.

One common approach to prevent other actions associated with the key you've
pressed is to use
keyascii=0
in your code, so the keystroke is not processed further.

HTH
- Turtle
"seeker52" <ak*****@hotmail.com> wrote in message
news:8c**************************@posting.google.c om...
if keyascii = 32 then
text0 = text0 & " "
text0.selstart = len(text0)
end if

This does exactly what it needs to do when a breakpoint is added
inside the if. Without the breakpoint the keypress does not work
properly. Why would this be and how can it be rectified?

seeker53

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.