This article is a mirror article of machine translation, please click here to jump to the original article.

View: 19314|Reply: 0

[WinForm] C# control dual buffer control

[Copy link]
Posted on 6/2/2017 11:03:23 AM | | |
In a project, controls flicker when they change size.
Solved with double buffer technology.

Or:


Member Namesillustrate
ContainerControlSuch asIndeed true, then the control is a container-like control.
UserPaintSuch asIndeed true, the controls will draw on their own, not through the operating system. Such asIndeedfalse, the Paint event will not be raised. This style applies only to classes that derive from Control.
OpaqueSuch asIndeed true, the control is drawn as opaque and does not draw the background.
ResizeRedrawSuch asIndeed trueredraws when the control is resizedControls.
FixedWidthSuch asIndeed true, the control has a fixed width when autoscaling. For example, if a layout operation attempts to rescale a control to fit a new Font, the control's Width will remain the same.
FixedHeightSuch asIndeed true, the control has a fixed height when autoscaling. For example, if a layout operation tries to rescale a control to fit a new font, the control's Height will remain the same.
StandardClickSuch asIndeed true, the control will implement the standard Click behavior.
SelectableSuch asIndeed true, the control can receive focus.
UserMouseSuch asIndeed true, the control completes its own mouse processing, so the mouse event is not handled by the operating system.
SupportsTransparentBackColorSuch asIndeed true, the control accepts a BackColor with an alpha component less than 255 to simulate transparency. Only in the UserPaint bit is set totrueAnd the parent control is only simulated transparent when derived from Control.
StandardDoubleClickSuch asIndeed true, the control implements the standard DoubleClick behavior. If the StandardClick bit is not set to true, ignore this style.
AllPaintingInWmPaintSuch asIndeed true, the control will ignore the WM_ERASEBKGND window message to reduce flickering. Only if the UserPaint bit is set to trueThis style should be applied.
CacheTextSuch asIndeed true, the control keeps a copy of the text instead of getting a copy of the text from the Handle every time it is needed. This style defaults to false. This behavior improves performance but makes it difficult to keep your text in sync.
EnableNotifyMessageSuch asIndeed true, calls the OnNotifyMessage method for each message sent to the control's WndProc. This style defaults to false. EnableNotifyMessage does not work in partially trusted cases.
DoubleBufferSuch asIndeed true, then draws in the buffer, and the result is output to the screen when it is finished. Double buffers prevent flickering caused by control redrawing. If you set DoubleBuffer to true, then UserPaint and AllPaintingInWmPaint should also be set to true
OptimizedDoubleBufferSuch asIndeed true, the control is drawn in the buffer first, rather than directly onto the screen, which reduces flickering. If this property is set to true, you should also set AllPaintingInWmPaint to true
UseTextForAccessibilitySpecifies the value of the control's Text property, and if set, determines the default Active Accessibility name and shortcut key for the control.







Previous:.net/c# log4net logs cannot be written to a file
Next:.net/c# [Practice] field to customize the characteristics and take the value
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com