Click here to Skip to main content
15,905,238 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
while trying to select an item from combo box in windows application error message showing "SetProperty of "SelectedItem" is not supported on control type: Window"
Posted
Comments
Richard MacCutchan 5-Nov-15 5:26am    
Please show your code; we cannot see your screen or read your disk.
nikhil2015 5-Nov-15 5:59am    
we have an XML file for object storing and test steps

objectRep = Global.current_context + ".xml";
objectText = s.GetText();
path = createFilepath(pName, objectRep);
tobject = orh.GetObject(path, s.Getobject());

WinComboBox h =(WinComboBox)tobject;
h.SelectedItem=objectText;

here the error occured
nikhil2015 5-Nov-15 6:05am    
<object type="WinComboBox" name="selectToolCombo">
<properties>

<property type="ControlName" value="cboCategory"/>
</properties>
</object>
nikhil2015 5-Nov-15 6:06am    
Dictionary<string, string=""> winComboBox = new Dictionary<string, string="">()
{

{ "name" , WinComboBox.PropertyNames.Name},
{ "ControlName" , WinComboBox.PropertyNames.ControlName},
{ "ClassName" , WinComboBox.PropertyNames.ClassName},




};
nikhil2015 5-Nov-15 6:07am    
case "WinComboBox":
WinComboBox wincmbBox = new WinComboBox(parent);
// htmlbutton.SearchProperties[hbutton[t.GetPropertyType()]] = t.GetPropertyValue();
foreach (KeyValuePair<string, string=""> kv in t.GetProperties())
{

wincmbBox.SearchProperties[winComboBox[kv.Key]] = kv.Value;
}
parent = wincmbBox;
break;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900