New topic: 

listBox1.listIndex = listBox1.listIndex+1 makes it jump 2

<http://forums.realsoftware.com/viewtopic.php?t=37966>

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        pbesong          Post subject: listBox1.listIndex = 
listBox1.listIndex+1 makes it jump 2Posted: Sun Mar 06, 2011 3:18 pm            
             
Joined: Fri Dec 09, 2005 6:25 pm
Posts: 215                I'm using the same code I use on my Mac app, but on 
Windows, when it's supposed to increment the selection to the next row of the 
listbox, it instead jumps 2 ahead. Here is the code for when I hit the Return 
key:
Code:  If Keyboard.AsynckeyDown(&h24) then  //This selects the next row every 
time you hit the Return key
   i = listBox1.listIndex
    i = i+1
    ListBox1.listIndex = i
  end if
  

Oddly enough, if I add a msgBox, it only increments one row at a time like it's 
supposed to:

Code:  If Keyboard.AsynckeyDown(&h24) then  //This selects the next row every 
time you hit the Return key
   i = listBox1.listIndex
    i = i+1
    ListBox1.listIndex = i
    msgBox str(i)
  end if
  

Any ideas?   
                             Top                 pbesong          Post subject: 
Re: listBox1.listIndex = listBox1.listIndex+1 makes it jump Posted: Sun Mar 06, 
2011 3:19 pm                         
Joined: Fri Dec 09, 2005 6:25 pm
Posts: 215                BTW, I tried both what was in the title of my post 
and what was in the code tags   
                             Top                 wbgookin          Post 
subject: Re: listBox1.listIndex = listBox1.listIndex+1 makes it jump Posted: 
Sun Mar 06, 2011 4:32 pm                         
Joined: Sat Aug 22, 2009 9:44 am
Posts: 171                Putting your non-msgbox code in the KeyDown routine 
of listbox1 works fine for me.  I'm using Windows 7 under VMWare Fusion.  One 
line at a time.   
                             Top                 pbesong          Post subject: 
Re: listBox1.listIndex = listBox1.listIndex+1 makes it jump Posted: Sun Mar 06, 
2011 4:36 pm                         
Joined: Fri Dec 09, 2005 6:25 pm
Posts: 215                thanks. i'll continue looking thru my project to see 
if something else is triggering this.   
                             Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to