System.Windows.Forms.DrawToolTipEventArgs.DrawBackground C# (CSharp) Method

DrawBackground() public method

public DrawBackground ( ) : void
return void
		public void DrawBackground ()
		{
			graphics.FillRectangle (new SolidBrush (back_color), bounds);
		}
				

Usage Example

Example #1
0
        // Handles drawing the ToolTip.
        private void toolTip_Draw(System.Object sender,
                                  System.Windows.Forms.DrawToolTipEventArgs e)
        {
            // Draw the ToolTip differently depending on which
            // control this ToolTip is for.
            // Draw a custom 3D border if the ToolTip is for button1.
            //if (e.AssociatedControl == fpPictureBox1)
            {
                // Draw the standard background.
                e.DrawBackground();

                // Draw the custom border to appear 3-dimensional.
                e.Graphics.DrawLines(SystemPens.ControlLightLight, new Point[] {
                    new Point(0, e.Bounds.Height - 1),
                    new Point(0, 0),
                    new Point(e.Bounds.Width - 1, 0)
                });
                e.Graphics.DrawLines(SystemPens.ControlDarkDark, new Point[] {
                    new Point(0, e.Bounds.Height - 1),
                    new Point(e.Bounds.Width - 1, e.Bounds.Height - 1),
                    new Point(e.Bounds.Width - 1, 0)
                });

                // Specify custom text formatting flags.
                TextFormatFlags sf = TextFormatFlags.VerticalCenter |
                                     TextFormatFlags.HorizontalCenter |
                                     TextFormatFlags.NoFullWidthCharacterBreak;

                // Draw the standard text with customized formatting options.
                e.DrawText(sf);
            }
        }
All Usage Examples Of System.Windows.Forms.DrawToolTipEventArgs::DrawBackground