IonicWind Software

IWBasic => GUI Central => Topic started by: billhsln on July 18, 2013, 11:13:21 PM

Title: Setting focus to Edit box
Post by: billhsln on July 18, 2013, 11:13:21 PM
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
Title: Re: Setting focus to Edit box
Post by: LarryMc on July 19, 2013, 04:58:19 AM
Add a SETFOCUS command like this:
setfocus w1,w1_EDIT01
WAITUNTIL w1 = 0
Title: Re: Setting focus to Edit box
Post by: billhsln on July 19, 2013, 09:17:13 AM
Thanks, LarryMc, that solved the problem and looks exactly as I wanted it to.

Thanks again,
Bill