Forum Discussion

Vahan's avatar
Vahan
Contributor
15 years ago

VB6 Combobox help

Hello all,

I am testing a VB6 application and would like to get the properties of a combobox (the number items, the list of items, etc). The combox is being reported as a ThunderRT6Combobox and the only operations I can do (or at least recognize as useful) seem to be click and settext. I would like to be able to get the list of items and be able to compare it to what is suppose to be there and also be able to select items in the list.



Thanks in advance,

Vahan  

7 Replies

  • Hi,



    You should be able to work with your combo box as it is described in the Working With Combo Box Controls help topic. If properties and methods specific to combo boxes are inaccessible, check the Object Mapping settings.
  • "You should be able to work with your combo box as it is described in the "Working With Combo Box Controls" help topic. If properties and methods specific to combo boxes are inaccessible, check the Object Mapping settings."



    I have tried this but I don't see any settings that allow for the selection of an item in the dropdown list



    Vahan
  • Hi,



    Open the Object Mapping settings of your project and make sure that your combo box's class is added to the Win32 Controls and Windows | Combo box group. See the Object Mapping help topic.
  • Hi Jared,



    Thanks! That seems to have done the trick.



    Vahan
  • Hi again Jared,



    As I said in my previous post I now have the actions that I am looking for. However I am having a curious problem with setting one particular combobox. If I set it to a constant value (say 2) it works fine. The problem is if I try to set it to a value from a table defined that has the values randomly defined (all valid) it gives an error. I have attached some screen shots 
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Vahan,



    That probably has to do with the type of variable being entered.  In your constant one, it appears you're using an integer as the ClickItem parameter which is, essentially, pointing to the index on the combo box.  In the table one, you're reading data out of a table which, depending upon the table source, might be getting interpreted/cast as a string instead of an integer.  In fact, the log message appears to be saying such because the 2 is wrapped in quotes indicating that it's looking for a string.



    You might want to double check your table data and make sure that the column in question is being indicated as an integer and not a string.  The other way to handle it is to have the ClickItem be passed a code expression where you're wrapping that table data with a StrToInteger call to make sure it's being clicked as a integer.
  • Hi Jared,

    I could have sworn I generated the data as integers but I regenerated them and now it works fine. 

    Thanks for the help



    Vahan