The User Drawn Button Text event allows the developer to take over control of the presentation of the text of each of the buttons in the control individually.
The User Drawn Button Text event fires before the button's text is drawn. The event passes an e argument that contains the following custom properties …
· e.ButtonState (of type enumButtonState): The state of the button to be drawn.
· e.CalculatorButton (of type enumCalcButton): The current button being drawn.
· e.Font (of type Font): Gets or sets the font of the button text being drawn.
· e.ForeColor (of type Color): Gets or sets the color used to paint the text in the button.
· e.Graphics (of type Graphics): A handle to the graphics object responsible for drawing the control. Through the e.Graphics object the developer has access to the GDI+ methods for drawing objects to a display device.
· e.PaintText (of type Boolean): Determines if the internal routines of the control should draw the button's text. When the PaintText property is set to False the control does not execute its internal paint routine and the developer has control over the drawing of the button's text.
· e.Rect (of type Rectangle): A rectangle representing the area being painted in the control. The rectangle is defined by an X,Y coordinate (top left of rectangle) and a width and height of the area being painted. All values are in pixels.
· e.Text (of type String): Gets or sets the text string to be be drawn in the button.