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

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist
Documentation Wiki Register Members List B4P 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, 12:44 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 614
Awards Showcase
Beta Tester 
Total Awards: 1
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
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #2 (permalink)  
Old 05-29-2007, 01:24 PM
Senior Member
 
Join Date: Apr 2007
Location: Copenhagen
Posts: 173
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, 03:03 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 614
Awards Showcase
Beta Tester 
Total Awards: 1
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
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #4 (permalink)  
Old 06-08-2007, 10:58 PM
Junior Member
 
Join Date: May 2007
Posts: 11
Default combobox.text

I have used:

Temp=combobox1.text

it works...!

Bye
Reply With Quote
  #5 (permalink)  
Old 06-09-2007, 12:47 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 993
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
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, 03:07 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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
  #7 (permalink)  
Old 11-18-2011, 11:35 AM
Newbie
 
Join Date: Apr 2011
Posts: 1
Exclamation Combo Text

Hi

actually this 'bug' is exactly what I want so don't 'fix' it please!

Here's the scenario: the user is selecting items (electrical device types) from a combo as they scan barcodes on the objects.

If an object type does not exist they need the ability to add it in the combo by typing it in - which the combobox allows you to do. Then I need to save that back to the lookup table so it's there next time, something which would be impossible if you couldn't access the combobox.text property!

Q. Why allow the user to type free-text into the combo if you then cannot access that text? Surely it should be locked to stop this if the text property is not supposed to be used?

Anyway, it's fine as it is, leave it alone please!
Reply With Quote
  #8 (permalink)  
Old 11-18-2011, 12:08 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,826
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

It is possible to change this behaviour with the Door library.
The code below alows entry of text.

You must load the Door library and define an object called obj1.
Code:
obj1.New1(False)
obj1.FromControl
"ComboBox1")
obj1.SetProperty(
"DropDownStyle","DropDown")
Best regards.
__________________
Klaus
Switzerland
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
Populate ComboBox linum Questions (Windows Mobile) 2 09-03-2008 09:44 PM
ComboBox ceaser Questions (Windows Mobile) 2 08-25-2008 04:52 PM
AddEvent with ComboBox erik58 Questions (Windows Mobile) 2 05-24-2008 03:38 PM
ComboBox Raytracer Italian Forum 3 04-15-2008 05:15 PM
combobox and sqlite dennishea Questions (Windows Mobile) 2 03-22-2008 10:48 AM


All times are GMT. The time now is 09:50 PM.


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