Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Oct 16, 2018 3:38 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Next Control
PostPosted: Sat Oct 29, 2005 1:12 am 
Offline

Joined: Thu Oct 13, 2005 11:12 pm
Posts: 7
Hola!
How can I do (or simulate) this? NextControl.setfocus
RB "know" what's the 'next' control, because when I strike "TAB" key it gives the focus to the next control in the taborder. My question is how I can know what's the next control follow current.


Jose


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Oct 29, 2005 7:00 pm 
Offline

Joined: Sat Oct 01, 2005 5:19 pm
Posts: 3216
This is a guess, and I've never tried it.

I would image when you loop through all the controls on a page they loop in "controlOrder" so loop through the controls til you have the one you are currently on, then set the focus to the next one in the loop


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Oct 29, 2005 7:27 pm 
Offline

Joined: Fri Sep 30, 2005 2:17 pm
Posts: 171
Ok, for example:
dim foundMe as boolean

for i as integer = 0 to self.controlCount - 1
if foundMe and self.control( i ) isa RectControl then
RectControl( self.control( i ) ).setFocus()
exit
end if

if self.control( i ) is me then foundMe = True
next


-- SirG3


Top
 Profile  
Reply with quote  
 Post subject: Simulating ENTER
PostPosted: Tue Nov 01, 2005 8:10 pm 
Offline

Joined: Thu Oct 13, 2005 11:12 pm
Posts: 7
Thanks SirG3!
Based on your code I can simulate ENTER key instead TAB to advance to the next control. This is my code on the KeyDown event of an edit field:

dim foundMe as boolean

if key = chr(13) or key = chr(3) then
for i as integer = 0 to window.controlcount - 1
if foundMe and window.control( i ) isa RectControl then
RectControl( window.control( i ) ).setFocus()
exit
end if

if window.control( i ) is me then foundMe = True
next
key = chr(0)
Return True
end


Thanks again.

Jose


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group