4 4.13 Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-16 #1 我想得到鼠标下的构件, 就是当我用鼠标点击了一个form上的某个构件后, 我能得到它是什么构件?
L liuchuanbo Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-16 #2 ; (sender as tcoolbar).EdgeInner:=esLowered; (sender as tcoolbar).EdgeOuter:=esLowered; Patterncoolbar.EdgeInner:=esRaised; Patterncoolbar.EdgeOuter:=esRaised; -->(sender as tobject).name (=the component's name)
; (sender as tcoolbar).EdgeInner:=esLowered; (sender as tcoolbar).EdgeOuter:=esLowered; Patterncoolbar.EdgeInner:=esRaised; Patterncoolbar.EdgeOuter:=esRaised; -->(sender as tobject).name (=the component's name)
4 4.13 Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-16 #3 faint! sorry, 我没talk清楚 现在可以得到mouse在form上的位置, 我如何得到form上在此位置的构件是什么?
L LeeChange Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-16 #4 申明一全局变量: AObject: TObject; 编写Form上所有控件的OnMouseMove procedure MouseMove(Sender: TObject;..) begin AObject:=Sender end
申明一全局变量: AObject: TObject; 编写Form上所有控件的OnMouseMove procedure MouseMove(Sender: TObject;..) begin AObject:=Sender end
4 4.13 Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-16 #5 天呀, 我依稀回忆到有一个函数可以用, 就是取当前mouse位置下的构件的, 所以就ask一下, 希望有人知。 不然,我就只有用: for i:=0 to form.componentcount-1 do begin if ptinrect(pt) then ...... end;
天呀, 我依稀回忆到有一个函数可以用, 就是取当前mouse位置下的构件的, 所以就ask一下, 希望有人知。 不然,我就只有用: for i:=0 to form.componentcount-1 do begin if ptinrect(pt) then ...... end;
4 4.13 Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-16 #7 ok, 就是它了ControlAtPos thanks opubf.