public enum ControlStyles(控件样式)
控件样式文件(来自微软)
1 using System; 2 3 namespace System.Windows.Forms 4 { 5 using System.ComponentModel; 6 using System.Diagnostics; 7 using System; 8 9 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles"]/*' /> 10 /// <devdoc> 11 /// <para> 12 /// Specifies control functionality. 13 /// 指定控制功能。 14 /// </para> 15 /// </devdoc> 16 [Flags] 17 public enum ControlStyles 18 { 19 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.ContainerControl"]/*' /> 20 /// <devdoc> 21 /// Indicates whether the control is a container-like control. 22 /// 指示该控件是否类似于容器控件。 23 /// </devdoc> 24 ContainerControl = 0x00000001, 25 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.UserPaint"]/*' /> 26 /// <devdoc> 27 /// <para> 28 /// The control paints itself; WM_PAINT and WM_ERASEBKGND messages are not passed 29 /// on to the underlying NativeWindow. 30 /// 控件绘制自身; WM_PAINT 和 WM_ERASEBKGND 消息不会传递到底层的 NativeWindow。 31 /// </para> 32 /// <para> 33 /// This style only applies to subclasses of Control. 34 /// 此样式仅适用于控件的子类。 35 /// </para> 36 /// </devdoc> 37 UserPaint = 0x00000002, 38 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.Opaque"]/*' /> 39 /// <devdoc> 40 /// <para> 41 /// If specified, a PaintBackground event will not be raised, OnPaintBackground will not be called, 42 /// and Invalidate() will not invalidate the background of the HWND. 43 /// 如果指定,将不会引发PaintBackground 事件,也不会调用 OnPaintBackground,并且 Invalidate () 。 44 /// </para> 45 /// </devdoc> 46 Opaque = 0x00000004, 47 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.ResizeRedraw"]/*' /> 48 /// <devdoc> 49 /// <para> 50 /// The control is completely redrawn when it is resized. 51 /// 控件调整大小时将完全重绘。 52 /// </para> 53 /// </devdoc> 54 ResizeRedraw = 0x00000010, 55 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.FixedWidth"]/*' /> 56 /// <devdoc> 57 /// <para> 58 /// The control has a fixed width. 59 /// 控件具有固定宽度。 60 /// </para> 61 /// </devdoc> 62 FixedWidth = 0x00000020, 63 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.FixedHeight"]/*' /> 64 /// <devdoc> 65 /// <para> 66 /// The control has a fixed height. 67 /// 控件具有固定高度。 68 /// </para> 69 /// </devdoc> 70 FixedHeight = 0x00000040, 71 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.StandardClick"]/*' /> 72 /// <devdoc> 73 /// <para> 74 /// If set, windows forms calls OnClick and raises the Click event when the control is clicked 75 /// (unless it's the second click of a double-click and StandardDoubleClick is specified). 76 /// Regardless of this style, the control may call OnClick directly. 77 /// 如果设置,窗口窗体将调用 OnClick 并引发单击控件时单击的 Click 事件(除非这是双击的第二次单 78 /// 击,并且指定了标准双击)。 79 /// 无论此样式如何,控件都可以直接调用 OnClick。 80 /// </para> 81 /// </devdoc> 82 StandardClick = 0x00000100, 83 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.Selectable"]/*' /> 84 /// <devdoc> 85 /// <para> 86 /// The control can get the focus. 87 /// 控件可获得焦点。 88 /// </para> 89 /// </devdoc> 90 Selectable = 0x00000200, 91 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.UserMouse"]/*' /> 92 /// <devdoc> 93 /// <para> 94 /// The control does its own mouse processing; WM_MOUSEDOWN, WM_MOUSEMOVE, and WM_MOUSEUP messages are not passed 95 /// on to the underlying NativeWindow. 96 /// 该控件执行自己的鼠标处理; WM_MOUSEDOWN 、 WM_MOUSEMOVE 和 WM_MOUSEUP 消息不会传递到底层的 NativeWindow。 97 /// </para> 98 /// </devdoc> 99 UserMouse = 0x00000400, 100 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.SupportsTransparentBackColor"]/*' /> 101 /// <devdoc> 102 /// <para> 103 /// If the BackColor is set to a color whose alpha component is 104 /// less than 255 (i.e., BackColor.A < 255), OnPaintBackground will simulate transparency 105 /// by asking its parent control to paint our background. This is not true transparency -- 106 /// if there is another control between us and our parent, we will not show the control in the middle. 107 /// 如果背景色设置为 alpha 分量小于 255 的颜色 (即,BackColor.A <255),OnPaintBackground 将通过要求其父控件 108 /// 绘制我们的背景来模拟透明度。这不是真正的透明度 -- 如果我们和父母之间有另一个控件,我们不会在中间显示控件。 109 /// </para> 110 /// <para> 111 /// This style only applies to subclasses of Control. It only works if UserPaint is set, 112 /// and the parent control is a Control. 113 /// </para> 114 /// </devdoc> 115 SupportsTransparentBackColor = 0x00000800, 116 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.StandardDoubleClick"]/*' /> 117 /// <devdoc> 118 /// <para> 119 /// If set, windows forms calls OnDoubleClick and raises the DoubleClick event when the control is double clicked. 120 /// Regardless of whether it is set, the control may call OnDoubleClick directly. 121 /// This style is ignored if StandardClick is not set. 122 /// 如果设置,windows 窗体将调用 OnDoubleClick,并在双击控件时引发 DoubleClick 事件。无论是否设置,控件都可以直接调 123 /// 用 OnDoubleClick。如果未设置标准单击,则忽略此样式。 124 /// </para> 125 /// </devdoc> 126 StandardDoubleClick = 0x00001000, 127 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.AllPaintingInWmPaint"]/*' /> 128 /// <devdoc> 129 /// <para> 130 /// If true, WM_ERASEBKGND is ignored, and both OnPaintBackground and OnPaint are called directly from 131 /// WM_PAINT. This generally reduces flicker, but can cause problems if other controls 132 /// send WM_ERASEBKGND messages to us. (This is sometimes done to achieve a pseudo-transparent effect similar to 133 /// ControlStyles.SupportsTransparentBackColor; for instance, ToolBar with flat appearance does this). 134 /// This style only makes sense if UserPaint is true. 135 /// 如果为 true,则忽略WM_ERASEBKGND,并且直接从WM_PAINT调用 OnPaint 背景和 OnPaint。 这通常会减少闪烁, 136 /// 但如果其他控件向我们发送WM_ERASEBKGND消息,则可能会导致问题。 137 /// (有时这样做是为了达到类似于 ControlStyles 的伪透明效果。 仅当 UserPaint 为 true 时,此样式才有意义。) 138 /// </para> 139 /// </devdoc> 140 AllPaintingInWmPaint = 0x00002000, 141 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.CacheText"]/*' /> 142 /// <devdoc> 143 /// <para> 144 /// If true, the control keeps a copy of the text rather than going to the hWnd for the 145 /// text every time. This improves performance but makes it difficult to keep the control 146 /// and hWnd's text synchronized. 147 /// This style defaults to false. 148 /// 如果为 true,则控件将保留文本的副本,而不是每次都转到文本的 hWnd。这提高了性能,但很 149 /// 难保持控件和 hWnd 的文本同步。此样式默认为 false。 150 /// </para> 151 /// </devdoc> 152 CacheText = 0x00004000, 153 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.EnableNotifyMessage"]/*' /> 154 /// <devdoc> 155 /// <para> 156 /// If true, the OnNotifyMessage method will be called for every message sent to the control's WndProc. 157 /// This style defaults to false. 158 /// 如果为 true,将为发送到控件的 WndProc 的每条消息调用 OnNotifyMessage 方法。 159 /// 此样式默认为 false。 160 /// </para> 161 /// </devdoc> 162 EnableNotifyMessage = 0x00008000, 163 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.DoubleBuffer"]/*' /> 164 /// <devdoc> 165 /// <para> 166 /// If set, all control painting will be double buffered. You must also 167 /// set the UserPaint and AllPaintingInWmPaint style. Note: This is obsolete, please 168 /// use OptimizedDoubleBuffer instead. 169 /// 如果设置,则所有控件绘制都将加倍缓冲。您还必须设置"用户绘画"和"全绘制"样式。 170 /// 注意:这是过时的,请改用优化DoubleBuffer。 171 /// </para> 172 /// </devdoc> 173 [EditorBrowsable(EditorBrowsableState.Never)] // It is recommended that you use the DoubleBuffer property instead. See VSWhidbey 502873 174 DoubleBuffer = 0x00010000, 175 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.OptimizedDoubleBuffer"]/*' /> 176 /// <devdoc> 177 /// <para> 178 /// If set, all control painting will be double buffered. 179 /// 如果设置,则所有控件绘制都将加倍缓冲。 180 /// </para> 181 /// </devdoc> 182 OptimizedDoubleBuffer = 0x00020000, 183 /// <include file='doc\ControlStyles.uex' path='docs/doc[@for="ControlStyles.UseTextForAccessibility"]/*' /> 184 /// <devdoc> 185 /// <para> 186 /// If this style is set, and there is a value in the control's Text property, that value will be 187 /// used to determine the control's default Active Accessibility name and shortcut key. Otherwise, 188 /// the text of the preceding Label control will be used instead. 189 /// This style is set by default. Certain built-in control types such as TextBox and ComboBox 190 /// un-set this style, so that their current text will not be used by Active Accessibility. 191 /// 192 /// 如果设置了此样式,并且控件的 Text 属性中有一个值,则该值将用于确定控件的默认"活动辅助功能"名称 193 /// 和快捷键。否则,将改用前面的 Label 控件的文本。默认情况下设置此样式。某些内置控件类型(如 TextBox 194 /// 和 ComboBox)取消设置此样式,以便活动辅助功能功能不会使用其当前文本。 195 /// </para> 196 /// </devdoc> 197 UseTextForAccessibility = 0x00040000, 198 } 199 }
翻译内容,参考了 微软梵音,钉钉只能翻译。可能还有不准确的地方,敬请指正。