Desktop application オブジェクト - ControlAtPoint メソッド

指定の場所のコントロールを返します。

Desktop application オブジェクト (PRIM_APPL) のメンバ

パラメーター

名前タイプデータ タイプ記述
Control*Result (任意)PRIM_CTRL検索するコントロール
Left*Input (任意)整数左の位置(ピクセル)
Top*Input (任意)整数上の位置(ピクセル)
ControlPart*Output (任意)PRIM_OBJT指定された地点のコントロールへの参照

詳細

ControlAtPoint プロパティは、現在マウスポインタの下にあるコントロールへの参照を返します。

この例では、パネル上でホバーイベントが発生すると、ControlAtPoint を使用して現在マウスの下にあるコントロールを判別します。
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Clientheight(172) Clientwidth(364) Height(211) Left(137) Top(198) Width(380)
 
   Define_Com Class(#PRIM_VS.Style) Name(#Style1) Backgroundbrush(#Brush1)
   Define_Com Class(#PRIM_VS.SolidBrush) Name(#Brush1) Color(Theme100)
 
   Define_Com Class(#PRIM_PANL) Name(#Panel) Displayposition(1) Left(16) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(15) Height(146) Width(337) Style(#Style1)
   Define_Com Class(#PRIM_PHBN) Name(#Button1) Caption('Button1') Displayposition(1) Left(28) Parent(#Panel1) Tabposition(1) Top(32)
   Define_Com Class(#PRIM_PHBN) Name(#Button2) Caption('Button2') Displayposition(2) Left(128) Parent(#Panel1) Tabposition(2) Top(32)
   Define_Com Class(#PRIM_PHBN) Name(#Button3) Caption('Button3') Displayposition(3) Left(224) Parent(#Panel1) Tabposition(3) Top(32)
 
   Evtroutine Handling(#Panel.MouseHover)
 
      #Com_owner.Caption := #sys_appln.ControlAtPoint.Name
 
 Endroutine
 
 End_Com

参照

すべてのコンポーネント クラス

テクニカルリファレンス

2018 - V14SP1