Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Listbox and enter key

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-13-2008, 10:04 AM
Basic4ppc Veteran
 
Join Date: Apr 2008
Location: Gosford NSW Australia
Posts: 223
Send a message via MSN to tsteward
Default Listbox and enter key

I want to have a listbox where I can scroll up and down using the cursor keys (no problem here it does that by default) now I wish to trigger a sub when I press enter or cMiddle.

Is this possible?
How please?

Thank you,

Tony
__________________
PC: Dual core 3.4ghz 2gb ram
PPC: I-mate Jasjam
Reply With Quote
  #2 (permalink)  
Old 10-13-2008, 01:49 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

It is possible with the Door library:
Obj is an Object and keyDownEvent is an Event (from the Door library).
Code:
Sub Globals
    
'Declare the global variables here.

End Sub

Sub App_Start
    Form1.Show
    obj.New1(
False)
    obj.FromControl(
"Listbox1")
    keyDownEvent.New1(obj.Value,
"KeyPress")
End Sub

Sub keyDownEvent_NewEvent
    obj.Value = keyDownEvent.Data
    
If Asc(obj.GetProperty("KeyChar")) = 13 Then
        
Msgbox("The following item was selected: " & _ 
            ListBox1.Item(ListBox1.SelectedIndex))
    
End If
End Sub
Reply With Quote
  #3 (permalink)  
Old 10-14-2008, 06:30 AM
Basic4ppc Veteran
 
Join Date: Apr 2008
Location: Gosford NSW Australia
Posts: 223
Send a message via MSN to tsteward
Default

Thanks Erel,
I knew door lib could do it I just didn't know enough to know how.

Ta mate
__________________
PC: Dual core 3.4ghz 2gb ram
PPC: I-mate Jasjam
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
TextBox limit number of digit to enter mike2ppc Questions (Windows Mobile) 3 08-12-2008 08:34 PM
Seleccionar Items Listbox jorge perez sabio Spanish Forum 2 03-25-2008 11:50 AM
How to fix ListBox Items? Stellaferox Questions (Windows Mobile) 12 02-22-2008 09:50 AM
Listbox difficulties. dan kabestan Questions (Windows Mobile) 2 12-15-2007 06:24 PM
listbox = arraylist ? sloopa Questions (Windows Mobile) 1 05-07-2007 12:38 PM


All times are GMT. The time now is 02:42 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0