Combobox on tab forms event not functioning?

Discussion in 'Questions (Windows Mobile)' started by Rioven, Jun 16, 2007.

  1. Rioven

    Rioven Active Member Licensed User

    Hi!
    I add combobox1 to multi-tab form and then I use the event...
    Sub combobox1_SelectionChanged but seems not working.
    Could you please check?
    thanks
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I've tested with Basic4ppc version 5.00 and it works properly.
     
  3. specci48

    specci48 Well-Known Member Licensed User

    Hi Erel,

    I took the tabcontrol example and added a combobox to the third page. What is wrong with the following code if you say that all is working properly:

    Code:
    Sub Globals
    End Sub

    Sub App_Start
       Form1.Show
       AddButton(Form1,
    "Button1",0,0,80,40,"Button1")
       AddTextBox (Form1,
    "TextBox1",40,20,100,25,"")
       AddCombobox(Form1,
    "ComboBox1",40,20,100,25)
       
    For i = 1 to 9
          ComboBox1.add(i)
       
    Next
       tbc.New1 (
    "Form1"10,10200200)
       tbc.AddTabPage(
    "Page1")
       tbc.AddTabPage(
    "Page2")
       tbc.AddTabPage(
    "Page3")
       tbc.AddControl(
    "Button1",0,20,20)
       tbc.AddControl(
    "TextBox1",1,20,30)
       tbc.AddControl(
    "ComboBox1",2,20,30)
    End Sub

    Sub ComboBox1_SelectionChanged
       
    msgbox("Selected Entry: " & ComboBox1.Item(ComboBox1.SelectedIndex))
    End Sub
    specci48
     
  4. RandomCoder

    RandomCoder Well-Known Member Licensed User

    Are you using B4PPC version 5 because as I recall there was a problem in Version 4 that meant that ComboBox's and RadioButtons didn't work??

    Regards,
    RandomCoder
     
  5. specci48

    specci48 Well-Known Member Licensed User

    Yes, I've testet the above code with the latest version 5 ...

    specci48
     
  6. Rioven

    Rioven Active Member Licensed User

    I am using V5 and combobox event is working properly directly on forms but can't work on tab forms as specci48's sample codes.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    You are missing the arguments in the sub declaration.
    Sub ComboBox1_SelectionChanged (Index, Value)
    msgbox("Selected Entry: " & ComboBox1.Item(ComboBox1.SelectedIndex))
    End Sub
     
  8. Rioven

    Rioven Active Member Licensed User

    Thanks Erel, guys...I'll should keep that in mind.
     
  9. specci48

    specci48 Well-Known Member Licensed User

    I'm a :sign0104: and must have been blind all the time ... :sign0148:
     
  10. Erel

    Erel Administrator Staff Member Licensed User

Loading...