回复 10楼 eepcvfp
也可以用AddListItem方法加入ID示例:
程序代码:
of = CREATEOBJECT("TForm") of.Show(1) RETURN DEFINE CLASS TForm AS Form ADD OBJECT List1 AS ListBox PROCEDURE List1.Init this.AddListItem("张三", 3) this.AddListItem("李四", 5) this.AddListItem("张三", 1) this.AddListItem("王五", 7) ENDPROC PROCEDURE List1.Click thisform.Caption = "姓名:" + this.List(this.ListIndex) + ", " +; "ID:" + TRANSFORM(this.IndexToItemID(this.ListIndex)) ENDPROC ENDDEFINE