Forum Discussion

veera_bolli's avatar
veera_bolli
Occasional Contributor
14 years ago

Script when we select something from a ComboBox, The check Box should be checked

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="Word.Document" name="ProgId" />
<meta content="Microsoft Word 12" name="Generator" />
<meta content="Microsoft Word 12" name="Originator" />





Hi,


I want to write some script for check Boxes. Can you help?


On my application there is a ComboBox “Nationality “contains
different countries list. And there is Foreign Check box are there.


I want like


If we Select Nationality as other than SouthAfrica


 Then The Check Box
Foreign must and should be checked .


I tried with some script but its failed. I want in VB
Script.


Can you help?


 


              

2 Replies


  • Hi,





    The selected combo box item can be retrieved with the wSelectedItem property, and the state of the check box - with the wState property. You can also try recording the selection of an item from the combo box and checking the corresponding check box, then, adding the if statement to the resulting script to check the needed condition.





    For more information, refer to the Working With Combo Box Controls and Working With Check Box Controls help topics.
  • I use the Checked property of the checkbox.



    Just evaluate whether the Checked property is true.



    If  XYZ.WinFormsObject("chkYourCheckbox").Checked = True then

        Log.Message("Checkbox was checked")

    esle

        Log.Error("Checkbox was not checked")

    end if