Textbox focus change (automatic) VB 2008

R

Reboot327

I hope this is as simple as I think it is. I just can't figure it out.

Lets say I have three textboxes for a phone number maximum sizes are set for
3-3-4

What I want is when you enter the third char in the tbAreacode, it changes
the focus automaticlly to the tbPrefix, and after the third char is entered
it moves focus to the tbSubfix.

I have been looking in the event and I can not find an event that happens
when a textbox is full.(reached max char)

Also is there an (events window) that shows you what events are happen, when
you are debbugging??

Rob
 
A

Armin Zingler

Reboot327 said:
I hope this is as simple as I think it is. I just can't figure it out.

Lets say I have three textboxes for a phone number maximum sizes are set for
3-3-4

What I want is when you enter the third char in the tbAreacode, it changes
the focus automaticlly to the tbPrefix, and after the third char is entered
it moves focus to the tbSubfix.

I have been looking in the event and I can not find an event that happens
when a textbox is full.(reached max char)

In the Textchanged event, check the length of the String. If maximum
length is reached, call the next' Textbox Focus method. Be aware that
the user may type new characters not at the end of the text or paste
from the clipboard, so maybe you also want to check the
SelectionStart/Selectionlength properties.
Also is there an (events window) that shows you what events are happen, when
you are debbugging??

I'm not sure what you mean.
 
R

Reboot327

Thank you very much ,that was the perfect jumping point that I needed.

What I was talking about when I mentioned the (event window) is: Are there
any ways to monitor the events that are called while running a program in
debug. Let say I am running the PHONENUM program, and I want a list of all
events that happen during the running of the program, stuff like mouseover,
got focus, lost focus, textchanged, and the like. That way I can get a
better feel of what is happening in the background.

Thanks
Rob
 
A

Armin Zingler

Reboot327 said:
Thank you very much ,that was the perfect jumping point that I needed.

What I was talking about when I mentioned the (event window) is: Are there
any ways to monitor the events that are called while running a program in
debug. Let say I am running the PHONENUM program, and I want a list of all
events that happen during the running of the program, stuff like mouseover,
got focus, lost focus, textchanged, and the like. That way I can get a
better feel of what is happening in the background.

There is no way to be notified about every event because you'd have to
handle all of them. Though, many events are just reactions on windows
messages. A central procedure handling these messages is WndProc. You
could override it and put tracing code in there. But, instead of writing
the code for monitoring these messages, you can use "Spy++", coming with VS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top