Problem With Combo box

jothis

Active Member
Licensed User
Hi Friends

I Writed A Program With Combobox
Please See The Attachment
My Problem is When i Select Kerala As The State The District Combobox will show the districts in kerala . I Selected Thrissur as District. Then I changed State To Tamil Nadu. But The Thrissur Is Still there ! .
What Should I Do To Clear This Problem?
I used This Code
B4X:
Combobox2.Clear
Please Help Me
Jothis
:sign0085:
 

Attachments

  • New Thread.zip
    1.6 KB · Views: 201

specci48

Well-Known Member
Licensed User
Longtime User
Hello Jothis,

to clear even the actual selection of a combobox you can use this undocumented "feature":

B4X:
ComboBox2.Clear
ComboBox2.Text = ""

The .Text is not provided by the syntax help so you have to type it in manually.


specci48
 

klaus

Expert
Licensed User
Longtime User
I would suggest you to add this line
ComboBox2.SelectedIndex=0
at the end of the
ComboBox1_SelectionChanged
routine.

This selects automatically the first entry in in ComboBox2.

Personally I would also add
ComboBox1.SelectedIndex=0
just before
Form1.Show
in the App_Start routine.
This selects by default the first entry in ComboBox1.

The default selected entries could also be initialised with values from an Init file.

Attached a modified version.

Best regards.
 

Attachments

  • LIST.sbp
    1.5 KB · Views: 192
Cookies are required to use this site. You must accept them to continue using the site. Learn more…