IUIControl.1.Layout.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. using System.Drawing;
  2. using System.Windows.Forms;
  3. namespace Microsoft.Windows.Forms
  4. {
  5. partial interface IUIControl
  6. {
  7. /// <summary>
  8. /// 获取或设置父控件
  9. /// </summary>
  10. IUIControl UIParent
  11. {
  12. get;
  13. set;
  14. }
  15. /// <summary>
  16. /// 获取子控件集合
  17. /// </summary>
  18. UIControl.UIControlCollection UIControls
  19. {
  20. get;
  21. }
  22. /// <summary>
  23. /// 获取或设置控件的区域
  24. /// </summary>
  25. Region Region
  26. {
  27. get;
  28. set;
  29. }
  30. /// <summary>
  31. /// 获取或设置停靠方式
  32. /// </summary>
  33. DockStyle Dock
  34. {
  35. get;
  36. set;
  37. }
  38. /// <summary>
  39. /// 获取或设置锚定方式
  40. /// </summary>
  41. AnchorStyles Anchor
  42. {
  43. get;
  44. set;
  45. }
  46. /// <summary>
  47. /// 获取或设置距离父控件的左边距
  48. /// </summary>
  49. int Left
  50. {
  51. get;
  52. set;
  53. }
  54. /// <summary>
  55. /// 获取或设置距离父控件的上边距
  56. /// </summary>
  57. int Top
  58. {
  59. get;
  60. }
  61. /// <summary>
  62. /// 获取或设置宽度
  63. /// </summary>
  64. int Width
  65. {
  66. get;
  67. set;
  68. }
  69. /// <summary>
  70. /// 获取或设置高度
  71. /// </summary>
  72. int Height
  73. {
  74. get;
  75. set;
  76. }
  77. /// <summary>
  78. /// 获取距离父控件的右边距
  79. /// </summary>
  80. int Right
  81. {
  82. get;
  83. }
  84. /// <summary>
  85. /// 获取距离父控件的下边距
  86. /// </summary>
  87. int Bottom
  88. {
  89. get;
  90. }
  91. /// <summary>
  92. /// 获取或设置控件左上角的坐标
  93. /// </summary>
  94. Point Location
  95. {
  96. get;
  97. set;
  98. }
  99. /// <summary>
  100. /// 获取或设置控件的大小
  101. /// </summary>
  102. Size Size
  103. {
  104. get;
  105. set;
  106. }
  107. /// <summary>
  108. /// 获取或设置控件的位置和大小
  109. /// </summary>
  110. Rectangle Bounds
  111. {
  112. get;
  113. set;
  114. }
  115. /// <summary>
  116. /// 获取控件客户区大小
  117. /// </summary>
  118. Size ClientSize
  119. {
  120. get;
  121. set;
  122. }
  123. /// <summary>
  124. /// 获取控件客户区的位置和大小
  125. /// </summary>
  126. Rectangle ClientRectangle
  127. {
  128. get;
  129. }
  130. /// <summary>
  131. /// 获取或设置内边距
  132. /// </summary>
  133. Padding Padding
  134. {
  135. get;
  136. set;
  137. }
  138. /// <summary>
  139. /// 获取布局操作是否被挂起
  140. /// </summary>
  141. bool LayoutSuspended
  142. {
  143. get;
  144. }
  145. /// <summary>
  146. /// 挂起布局操作
  147. /// </summary>
  148. void SuspendLayout();
  149. /// <summary>
  150. /// 恢复挂起的布局操作
  151. /// </summary>
  152. void ResumeLayout();
  153. /// <summary>
  154. /// 恢复挂起的布局操作,可选择是否强制执行布局
  155. /// </summary>
  156. /// <param name="performLayout">如果强制则为 true, 否则为 false</param>
  157. void ResumeLayout(bool performLayout);
  158. /// <summary>
  159. /// 如果未挂起布局操作则重新计算子控件布局
  160. /// </summary>
  161. void DoLayout();
  162. /// <summary>
  163. /// 将控件置于 Z 轴底层
  164. /// </summary>
  165. void SendToBack();
  166. /// <summary>
  167. /// 将控件置于 Z 轴顶层
  168. /// </summary>
  169. void BringToFront();
  170. /// <summary>
  171. /// 将屏幕坐标系的点转换为控件坐标系的点
  172. /// </summary>
  173. /// <param name="p">点</param>
  174. /// <returns>转换后的点</returns>
  175. Point PointToClient(Point p);
  176. /// <summary>
  177. /// 将控件坐标系的点转换为屏幕坐标系的点
  178. /// </summary>
  179. /// <param name="p">点</param>
  180. /// <returns>转换后的点</returns>
  181. Point PointToScreen(Point p);
  182. /// <summary>
  183. /// 将屏幕坐标系的矩形转换为控件坐标系的矩形
  184. /// </summary>
  185. /// <param name="r">矩形</param>
  186. /// <returns>转换后的矩形</returns>
  187. Rectangle RectangleToClient(Rectangle r);
  188. /// <summary>
  189. /// 将控件坐标系的矩形转换为屏幕坐标系的矩形
  190. /// </summary>
  191. /// <param name="r">矩形</param>
  192. /// <returns>转换后的矩形</returns>
  193. Rectangle RectangleToScreen(Rectangle r);
  194. /// <summary>
  195. /// 将所在 Win32 控件坐标系的点转换为控件坐标系的点
  196. /// </summary>
  197. /// <param name="p">点</param>
  198. /// <returns>转换后的点</returns>
  199. Point PointToUIControl(Point p);
  200. /// <summary>
  201. /// 将控件坐标系的点转换为所在 Win32 控件坐标系的点
  202. /// </summary>
  203. /// <param name="p">点</param>
  204. /// <returns>转换后的点</returns>
  205. Point PointToUIWindow(Point p);
  206. /// <summary>
  207. /// 将所在 Win32 控件坐标系的矩形转换为控件坐标系的矩形
  208. /// </summary>
  209. /// <param name="r">矩形</param>
  210. /// <returns>转换后的矩形</returns>
  211. Rectangle RectangleToUIControl(Rectangle r);
  212. /// <summary>
  213. /// 将控件坐标系的矩形转换为所在 Win32 控件坐标系的矩形
  214. /// </summary>
  215. /// <param name="r">矩形</param>
  216. /// <returns>转换后的矩形</returns>
  217. Rectangle RectangleToUIWindow(Rectangle r);
  218. /// <summary>
  219. /// 查找所在的 Win32 控件
  220. /// </summary>
  221. /// <returns>所在的 Win32 控件</returns>
  222. IUIWindow FindUIWindow();
  223. /// <summary>
  224. /// 根据坐标查找子控件
  225. /// </summary>
  226. /// <param name="p">坐标</param>
  227. /// <returns>子控件</returns>
  228. UIControl FindUIChild(Point p);
  229. /// <summary>
  230. /// 根据名称查找子控件
  231. /// </summary>
  232. /// <param name="name">名称</param>
  233. /// <returns>子控件</returns>
  234. UIControl FindUIChild(string name);
  235. }
  236. }