KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Get the value selected in a Listbox

 
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic
View previous topic :: View next topic  
Author Message
mima500
KiXforms Regular
KiXforms Regular


Joined: 11 Dec 2003
Posts: 48
Location: Sweden

PostPosted: Fri Dec 21, 2007 8:30 am    Post subject: Get the value selected in a Listbox Reply with quote

Hi

How to get the value selected in a Listbox ?
Listindex only gives me the index, not the value.

Another question: If a want scrollbars in a listbox, how do I do, maybe not using Listbox ?
Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Fri Dec 21, 2007 11:19 am    Post subject: Reply with quote

Try .SelectedIndex, but with a ComboBox!

To change the style to Listbox like, change DropDownStyle to 0
The scrollbars should appear automagically dependant of the content and the bounds of the control ... not sure though!

It may be even better to use a ListView Control Smile

If you have any problems with this information ask back again Mr. Green

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
magicmajid
KiXforms Dabbler
KiXforms Dabbler


Joined: 14 Mar 2008
Posts: 8

PostPosted: Fri Mar 28, 2008 3:24 pm    Post subject: Reply with quote

Here the solution if you have a listbox called $listbox.

$Item = $listbox.text

There does have to be a function that puts it in te variable.
Code:

; Here is the listbox
$listbox = $RDP.Controls.ListBox()
$listbox.Location = 13, 13
$listbox.Size = 317, 212
$listbox.OnClick = "listboxOnClick( $$listbox )"

; The function if used with a button example add.
Function add( $object )
   $Item = $listbox.text
        ? "This item is added: " + $Item
EndFunction

; With this function it wil be added just by clicking it.
Function listbox( $object)
        $Item = $listbox.text
        ? "This item is added in the memory:" + $item
EndFunction

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group