Basic4ppc - Windows Mobile Development  

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

Questions & Help Needed Post any question regarding Basic4ppc.


ComboBox


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-25-2008, 02:53 PM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 286
Default ComboBox

Help (Again!)

The following code is when the user clicks on OptionButton2 to select a Total Station. I have three options: OptionButton1 is for a Engineering Level, OptionButton2 is for a Total Station and OptionButton3 is for a GPS. The idea is that the user can select different surveying instruments that he\she works with.

All the different setting for the different instruments are stored in an array called DF().

When the surveyor selects the settings for the first time, the index of the array will be "0".....DF(0)=0, DF(1)=0, DF(2)=0,etc.

What I then use is ComboboxName.SelectedIndex=DF(0), etc

It works fine but not with the last line in the next sub.

Sub OptionButton2_Click
'SaveData
OptionButton1.Checked=False
OptionButton3.Checked=False
InstMake.clear
InstMake.add ("Manual")
InstMake.add ("Leica")
InstMake.add ("Nikon")
InstMake.add ("Topcon")
InstMake.add ("Geodimeter")
InstMake.add ("Pentax")
InstMake.add ("Sokkia")
InstMake.add ("Trimble")
InstMake.add ("Fujiyama")
InstMake.add ("Precision")
DF(100)=1
InstModel.clear
InstMode.clear
InstMode.add ("Fine")
InstMode.add ("Coarse")
InstTrigger.clear
InstTrigger.add ("Instr")
InstTrigger.add ("PPC")
If DF(3)>0 Then InstMake.SelectedIndex=DF(3)
If DF(4)>0 Then InstModel.SelectedIndex=DF(4)
InstTrigger.SelectedIndex=DF(1)
InstMode.SelectedIndex=DF(15)
InstMode.Left=110 :Label31.Left=8
InstTrigger.Left=110 :Label32.Left=8
' get the instrument models
'CheckInstModel
InstModel.SelectedIndex=DF(4)
End Sub

InstModel will depend on what instrument make is selected, ie. if a Leica is selected, then the different models will be a TC1000, TC300, TC400,TC600...etc.

Now in the routine above DF(4) will be "0" when accessed for the first time, untill it has been changed by the user.

But the program keeps on telling me the value cannot be "0"

Please help.

Thanks
Michael
Reply With Quote
  #2 (permalink)  
Old 08-25-2008, 03:22 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 1,815
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Hi Michael,

I suspect that there is nothing in the ComboBox and the program doesn't accept value 0 for SelectedItem becaude there is none.

Where do you fill the InstModel ComboBox ? In the CheckInstModel, it is not active it is a comment in your code ?

Best regards.
__________________
Klaus
Switzerland
Reply With Quote
  #3 (permalink)  
Old 08-25-2008, 03:52 PM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 286
Default

Hi Klaus

Danke. It works!! Something else I did wrong was to use the "Click" event on the listbox and not "SelectionChanged". I am still getting mixed up with NSBasic.

Thanks
Michael
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
Populate ComboBox linum Questions & Help Needed 2 09-03-2008 08:44 PM
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
ComboBox Value RandomCoder Basic4ppc Wishlist 5 06-09-2007 02:07 PM


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


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