本文介绍了在枚举了combox值时,在文本框中输入值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



假设我有一个文本框调用val1和combox,它有三个索引(Meter,Feet,Inches)。假如最初用户在texfield(val1)中输入值1并从组合框中选择feet。现在我无法解决的是,现在突然他只是从组合框中选择英寸,现在我希望文本框中的值以英寸(应该是12)转换。我知道如何转换它的公式:)但我不知道如何知道最后选择的值是什么,或者可能是某人可以指导我如何解决这个问题。



非常感谢



reagrds

Hello

Say i have a textbox call val1 and combox that has three indexes (Meter,Feet,Inches). Say if initially user entered the value "1" in the texfield(val1) and selected "feet" from combobox. Now what i am not been able to solve is that say now suddenly he just selects inches from combobox, now i want the value in the textbox to be converted in inches(should be 12). I know the formula how to convert it :) but i donot know how to know what was the last selected value or may be if some one can guide me how this case can be solved.

Thanks anyways

reagrds

推荐答案

int FormLevelcmbbox1LastValue  = 0;



现在在combox的选择值更改中


now in combox's selection value change

cmbbox1_selectedValueChange(...)
{
	ConvertFrom = FormLevelcmbbox1LastValue ;
	ConvertTo = cmbbox1.selectedValue ;
	//write stuff to change value of textbox
	//set FormLevelcmbbox1LastValue
	FormLevelcmbbox1LastValue = cmbbox1.selectedValue ;
}



快乐编码!

:)


Happy Coding!
:)



这篇关于在枚举了combox值时,在文本框中输入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 15:36