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

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

Desktopapplicationオブジェクト (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


参照

すべてのコンポーネント クラス
テクニカルリファレンス

  • No labels