c# - Multiply value selected in combobox by a number in label -


i trying work out how multiply selected value in combobox string value stored in label. have tried converting both values ints error keeps appearing:

unable cast object of type 'system.windows.controls.comboboxitem' type 'system.iconvertible'.

int quantity = convert.toint32(combobox3.selecteditem); int price = convert.toint32(label1.content); label2.content = quantity*price; 

many thanks

i don't quite remember exact property of comboboxitem (i think text), need value of string rather whole object perform conversion. after that, use int's parsestring class method.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -