Forum Discussion

farhanahmed's avatar
farhanahmed
Contributor
13 years ago

How to select multiple items in check list box?

Hi all i have two questions

How can i  select multiple items in check list box?

and how can i get multiple selected items?



-farhan
  • Hi,


    Could you please clarify the type of the control you want to test and specify its class name?


    Thanks in advance.

    Ann

  • Hi

    I am testing Application developed in C#  by using Testcomplete 8 class name of the control is system.windows.forms and it is CheckListBox.



    -farhan
  • Hi


    I guess your control should be supported as a standard list box. Inspect it in the Object Browser and check whether it has the specific wSelectedItems property and MultiSelect method. You can use the MultiSelect method to select several items and then obtain all of the selected items using the wSelectedItems property.


    Another option is to find appropriate native properties and methods and use them in your tests.


    I hope this information helps.

    Ann

  • Hi

    When i use MultiSelect method error appears that control does not support multiple selection.

    is there any other way?

    -regards


  • Hi,

    As it is described in TestComplete's help, a list box must have the LBS_MULTIPLESEL or LBS_EXTENDEDSEL style, otherwise, the method would not be able to check several items at a time. Set one of these styles for your control or try to find appropriate native methods to work with it.


    By the way, we have a Control Support Survey. If you need specific support for your control, you can vote for it.


    Ann