|
' B2 q% w! J( Q. U k) \' q; m1 C生成控件,然后设定控件对应的单击函数和双击函数 , u& x. l3 N+ \$ ~ ]
void __fastcall myImageClick(TObject *Sender)
% I/ W$ n( n' t" s{
1 `& P% l8 s# v% `5 W3 N do what you want to do c9 W: ?* s* c |9 s" s* |
}
2 Y! R! {" U( @6 L" i3 BTImage myImage=new TImage();
4 f- P: N' H3 X: M! z" t4 V7 CmyImage->parent=this;
: s0 s8 ~5 W! K p; H# V1 DmyImage->left=??
}3 R2 `0 Q JmyImage->top=?? * ^# \! v4 I. i& B; L0 l
myImage->width=;
0 q0 | K1 h& W( Q! ?, B+ C0 ymyImage->Height=;
& C' G$ }2 E8 v. m# L7 g+ l: MmyImage->visible=true;
$ e S7 X4 U8 t: D8 T3 O. i1 TmyImage->OnClick=myImageClick;//动态绑定事件
3 D$ S0 p, U" j) h2 p9 w" K双击也类似 |