I have a Combobox named "CB_x" defined in WPF and I have selections "0,5,10,15,20". What method can I use to achieve the following (which doesn't work)?
char x;
x = (char)CB_x.SelectionBoxItem; // item selected is a string "20", I need a char 20.
It compiles, but gives a casting error. Is there to atoi() method somewhere?
Loading
VulpesPosted Nov 3, 2011, 1:10 PM
VulpesPosted Nov 3, 2011, 12:50 PM
Sutton MehaffeyPosted Nov 3, 2011, 12:41 PM
Sutton MehaffeyPosted Nov 3, 2011, 12:39 PM
int x;
x = (int)GlobalVars.User_Parameters.alarm_holdoff; // alarm_holdoff is a char
CBAlarmHoldoff.SelectionBoxItem = x.ToString;
I was trying to do it this way too.
CBAlarmHoldoff.SelectionBoxItem = (int)GlobalVars.User_Parameters.alarm_holdoff.ToString();
VulpesPosted Nov 3, 2011, 11:43 AM
Sutton MehaffeyPosted Nov 3, 2011, 11:40 AM
When I read a char 20 from a file, how can I read that into the ComboBox?
x = 20;
CB_x.SelectionBoxItem = x.ToString(); // doesn't work
VulpesPosted Nov 2, 2011, 6:30 PM