April 26, 2024, 04:59:21 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Setting focus to Edit box

Started by billhsln, July 18, 2013, 11:13:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

billhsln

I have a simple program that gives you the distance in Miles or Kilometers from one zip code to another.  My problem is that I can't seem to get it to put focus onto the first input field.  The code works, you can tab or press enter to go between edit fields, but you have to put the cursor into one first.  I want it to start in the zip field with the zip code highlighted to allow me to change it.

Any help will be appreciated.  Also, I hope some one can find this of some use to them.

I give credit to a web site where I got the zip, latitude and longitude values from in the source.  It is a little modified, I did not need all the values it had.

Thanks,
Bill
When all else fails, get a bigger hammer.

LarryMc

Add a SETFOCUS command like this:
setfocus w1,w1_EDIT01
WAITUNTIL w1 = 0
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

Thanks, LarryMc, that solved the problem and looks exactly as I wanted it to.

Thanks again,
Bill
When all else fails, get a bigger hammer.