Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Basic4ppc Wishlist
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Basic4ppc Wishlist Missing any feature?


ComboBox Value


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-29-2007, 11:44 AM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 448
Default ComboBox Value

Hi Erel,

I have a form with several fields, some of these fields use ComboBox's to limit the choice to the user. I would like to be able to get the value from each ComboBox and the rest of the controls when the user clicks the finish button.

At present there appears to be two methods of doing this...
1) Use the SelectionChanged event on each ComboBox to obtain and store the value/text in a Global variable until the finish button is pressed.
2) On pressing the finish button, look at the SelectedIndex property for each ComboBox and then use a Select Case to determine what the actual value/text is.
Neither is particularly pretty.

It would be far better for me if I could just look at the value/text that has been selected when the finish button is pressed. Something like...

Field1Value=ComboBox1.Text

Is it possible to include a text property?? Maybe in the next version??

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #2 (permalink)  
Old 05-29-2007, 12:24 PM
Senior Member
 
Join Date: Apr 2007
Location: Copenhagen
Posts: 118
Default

I don't understand, why do you need the "select case" (in your alternative 2)?

Doesn't this give the text from the combobox:
txt=ComboBox.Item(ComboBox.SelectedIndex)

(It does for me )
Reply With Quote
  #3 (permalink)  
Old 05-29-2007, 02:03 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 448
Thumbs up

Thanks BjornF,

That's exactly what I was after (albiet a slight workaround)

I was using...

txt=ComboBox.SelectedIndex

which just returns the position of the chosen item

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #4 (permalink)  
Old 06-08-2007, 09:58 PM
Junior Member
 
Join Date: May 2007
Posts: 10
Default combobox.text

I have used:

Temp=combobox1.text

it works...!

Bye
Reply With Quote
  #5 (permalink)  
Old 06-09-2007, 11:47 AM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 560
Default

A combobox has is no official .text property.
Is it a bug or an "undocumented feature"

I think it shouldn't be used because it may not be supported in future versions of basic4ppc.


specci48
Reply With Quote
  #6 (permalink)  
Old 06-09-2007, 02:07 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,778
Default

The problem with ComboBox.Text is that on the desktop the user can write in the combobox and it will return the text that the user wrote.
The write syntax is: ComboBox.Item(ComboBox.SelectedItem)
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
AddEvent with ComboBox erik58 Questions & Help Needed 2 05-24-2008 02:38 PM
ComboBox Raytracer Italian Forum 3 04-15-2008 04:15 PM
combobox and sqlite dennishea Questions & Help Needed 2 03-22-2008 09:48 AM
IgnoreKey in ComboBox? kyto Questions & Help Needed 1 09-11-2007 04:51 AM
ComboBox.Value property Cableguy Questions & Help Needed 3 07-01-2007 02:09 PM


All times are GMT. The time now is 11:34 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0