PDA

View Full Version : capture keypress or keydown



geerae
01-02-2002, 08:46 AM
I was trying to use the IP Address component in a custom dialog but found out it doesn't work properly. After perusing this forum it appears that using (4) edit boxes, (1) for each octet and (3) static boxes, (1) for each dot (".") is the ticket.
I also found some great tips for setting focus on the next edit box after StrLength of 3.
I would like to add further functionality by having the focus move to the next edit box after a key board press of "." (ASCII 046), can anyone help me?

geerae

JacobLevin
01-03-2002, 09:17 AM
I'm not sure about the IP address control, but I know the edit field control will return the component ID to the dialog's message loop every time a key is pressed.

In your message loop for your custom dialog script you can include an option in your switch block for the case of this edit field. When a key is pressed you can then get the text from the field and check whether the last character is a '.' character. If so, then remove it and switch focus to the next.