TAG属性是整型的,因此可以用来存放指针。
goods := TGoods.Create(Button);
goods.goodsId := goodsId;
goods.goodsName := goodsName;
goods.price := price;
Button.Tag :=
THandle(goods);
TGoods(TcxButton(Sender).Tag).buyNum
原文:http://www.cnblogs.com/hnxxcxg/p/3580430.html