TStrings的AddObject方法应用

(1) integer 于 Object

cmbBox.Items.AddObject(A_Value,pointer(I_Value));

I_Ret:=cmbBox.itemindex;
I_perID:=integer(cmbBox.Items.Objects[I_Ret]);

(2) string 于 Object

A_Code:='custID';
ComboBox1.Items.AddObject('客户ID',TObject(A_Code));

A_Value:=string(ComboBox1.Items.Objects[ComboBox1.ItemIndex]);

Published At
Categories with Web编程
comments powered by Disqus