扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:lotusswan 来源:论坛 2007年11月1日
关键字:
private function GetText:String; procedure SetText(const Value:String); public property Text:String; read GetText write SetText; function TformDialog.GetText:String; begin Result:=Edit1.Text; end; procedure TformDialog.SetText(const Value:String); begin Edit1.Text;=Value; end; |
type TformDialog =class(TForm) private listItems:TlistBox; function GetItems(Index:Integer):String; procedure SetItems(Index:Integer:const Value:String); public property Items[Index:Integer]:string; end; function TFormDialog.GetItems(Index:Integer):string; begin if Index >=ListItems.Items.Count then raise Exception.Create(‘TformDialog:Out of Range’); Result:=ListItems.Items[Index]; end; procedure TformDialog.SetItems(Index:Integer;const alue:string); begin if Index >=ListItems.Items.Count then raise Exception.Create(‘TformDialog:Out of Range’); ListItems.Items[Index]:=Value; end; |
婵″倹鐏夐幃銊╂姜鐢瓕鎻╅崚鍥╂畱閹厖绨$憴顤廡妫板棗鐓欓張鈧弬棰侀獓閸濅椒绗岄幎鈧張顖欎繆閹垽绱濋柇锝勭疄鐠併垽妲勯懛鎶姐€婄純鎴炲Η閺堫垶鍋栨禒璺虹殺閺勵垱鍋嶉惃鍕付娴f娊鈧柨绶炴稊瀣╃閵嗭拷