Rendering standard visual style control elements
C#, Component Development, Graphics and Images February 23rd, 2006.Net provides a single class that can render most standard control elements such as Buttons, 3d rectangles checkboxes, etc using the current theme services.
This class is the static ControlPaint class. Some of the methods include:
DrawBorder(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style);
DrawBorder3D(Graphics graphics, Rectangle rectangle);
DrawButton(Graphics graphics, int x, int y, int width, int height, ButtonState state);
DrawCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state);
DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state);
DrawSizeGrip(Graphics graphics, Color backColor, Rectangle bounds);
In addition there are specific static Renderer classes availablehat provide measuring routines and rendering routines as well, such as:
ButtonRenderer
CheckBoxRenderer
TabRenderer
TextBoxRender
TextRenderer
ScrollBarRenderer
ToolStripRenderer
Recent Comments