123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- using System.Drawing;
- using System.Windows.Forms;
- namespace Microsoft.Windows.Forms
- {
- partial interface IUIControl
- {
- /// <summary>
- /// 获取或设置父控件
- /// </summary>
- IUIControl UIParent
- {
- get;
- set;
- }
- /// <summary>
- /// 获取子控件集合
- /// </summary>
- UIControl.UIControlCollection UIControls
- {
- get;
- }
- /// <summary>
- /// 获取或设置控件的区域
- /// </summary>
- Region Region
- {
- get;
- set;
- }
- /// <summary>
- /// 获取或设置停靠方式
- /// </summary>
- DockStyle Dock
- {
- get;
- set;
- }
- /// <summary>
- /// 获取或设置锚定方式
- /// </summary>
- AnchorStyles Anchor
- {
- get;
- set;
- }
- /// <summary>
- /// 获取或设置距离父控件的左边距
- /// </summary>
- int Left
- {
- get;
- set;
- }
- /// <summary>
- /// 获取或设置距离父控件的上边距
- /// </summary>
- int Top
- {
- get;
- }
- /// <summary>
- /// 获取或设置宽度
- /// </summary>
- int Width
- {
- get;
- set;
- }
- /// <summary>
- /// 获取或设置高度
- /// </summary>
- int Height
- {
- get;
- set;
- }
- /// <summary>
- /// 获取距离父控件的右边距
- /// </summary>
- int Right
- {
- get;
- }
- /// <summary>
- /// 获取距离父控件的下边距
- /// </summary>
- int Bottom
- {
- get;
- }
- /// <summary>
- /// 获取或设置控件左上角的坐标
- /// </summary>
- Point Location
- {
- get;
- set;
- }
- /// <summary>
- /// 获取或设置控件的大小
- /// </summary>
- Size Size
- {
- get;
- set;
- }
- /// <summary>
- /// 获取或设置控件的位置和大小
- /// </summary>
- Rectangle Bounds
- {
- get;
- set;
- }
- /// <summary>
- /// 获取控件客户区大小
- /// </summary>
- Size ClientSize
- {
- get;
- set;
- }
- /// <summary>
- /// 获取控件客户区的位置和大小
- /// </summary>
- Rectangle ClientRectangle
- {
- get;
- }
- /// <summary>
- /// 获取或设置内边距
- /// </summary>
- Padding Padding
- {
- get;
- set;
- }
- /// <summary>
- /// 获取布局操作是否被挂起
- /// </summary>
- bool LayoutSuspended
- {
- get;
- }
- /// <summary>
- /// 挂起布局操作
- /// </summary>
- void SuspendLayout();
- /// <summary>
- /// 恢复挂起的布局操作
- /// </summary>
- void ResumeLayout();
- /// <summary>
- /// 恢复挂起的布局操作,可选择是否强制执行布局
- /// </summary>
- /// <param name="performLayout">如果强制则为 true, 否则为 false</param>
- void ResumeLayout(bool performLayout);
- /// <summary>
- /// 如果未挂起布局操作则重新计算子控件布局
- /// </summary>
- void DoLayout();
- /// <summary>
- /// 将控件置于 Z 轴底层
- /// </summary>
- void SendToBack();
- /// <summary>
- /// 将控件置于 Z 轴顶层
- /// </summary>
- void BringToFront();
- /// <summary>
- /// 将屏幕坐标系的点转换为控件坐标系的点
- /// </summary>
- /// <param name="p">点</param>
- /// <returns>转换后的点</returns>
- Point PointToClient(Point p);
- /// <summary>
- /// 将控件坐标系的点转换为屏幕坐标系的点
- /// </summary>
- /// <param name="p">点</param>
- /// <returns>转换后的点</returns>
- Point PointToScreen(Point p);
- /// <summary>
- /// 将屏幕坐标系的矩形转换为控件坐标系的矩形
- /// </summary>
- /// <param name="r">矩形</param>
- /// <returns>转换后的矩形</returns>
- Rectangle RectangleToClient(Rectangle r);
- /// <summary>
- /// 将控件坐标系的矩形转换为屏幕坐标系的矩形
- /// </summary>
- /// <param name="r">矩形</param>
- /// <returns>转换后的矩形</returns>
- Rectangle RectangleToScreen(Rectangle r);
- /// <summary>
- /// 将所在 Win32 控件坐标系的点转换为控件坐标系的点
- /// </summary>
- /// <param name="p">点</param>
- /// <returns>转换后的点</returns>
- Point PointToUIControl(Point p);
- /// <summary>
- /// 将控件坐标系的点转换为所在 Win32 控件坐标系的点
- /// </summary>
- /// <param name="p">点</param>
- /// <returns>转换后的点</returns>
- Point PointToUIWindow(Point p);
- /// <summary>
- /// 将所在 Win32 控件坐标系的矩形转换为控件坐标系的矩形
- /// </summary>
- /// <param name="r">矩形</param>
- /// <returns>转换后的矩形</returns>
- Rectangle RectangleToUIControl(Rectangle r);
- /// <summary>
- /// 将控件坐标系的矩形转换为所在 Win32 控件坐标系的矩形
- /// </summary>
- /// <param name="r">矩形</param>
- /// <returns>转换后的矩形</returns>
- Rectangle RectangleToUIWindow(Rectangle r);
- /// <summary>
- /// 查找所在的 Win32 控件
- /// </summary>
- /// <returns>所在的 Win32 控件</returns>
- IUIWindow FindUIWindow();
- /// <summary>
- /// 根据坐标查找子控件
- /// </summary>
- /// <param name="p">坐标</param>
- /// <returns>子控件</returns>
- UIControl FindUIChild(Point p);
- /// <summary>
- /// 根据名称查找子控件
- /// </summary>
- /// <param name="name">名称</param>
- /// <returns>子控件</returns>
- UIControl FindUIChild(string name);
- }
- }
|