Ok, I think I may have it. I can get it to draw a region and fill it with a gradient.
Now I need to see if I can get it to draw on the background of my control
yet allow the text to be in front. If not then I will need to draw the text
too.
Note: this is on a button only as a test (75 x 23)
VB Code:
Private Sub Button1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Button1.Paint Dim myPath As New GraphicsPath 'Top line myPath.AddLine(7, 0, 64, 0) 'Right top arc myPath.AddArc(64, 0, 10, 10, 270, 90) 'Right line myPath.AddLine(74, 7, 74, 22) 'Bottom line myPath.AddLine(74, 22, 0, 22) 'Left line myPath.AddLine(0, 22, 0, 7) 'Left top arc myPath.AddArc(0, 0, 10, 10, 180, 90) ' Draw the path to the screen. Dim myPen As New Pen(Color.White, 1) e.Graphics.DrawPath(myPen, myPath) 'Draw the gradient Dim br As New LinearGradientBrush(Me.ClientRectangle, Color.White, Color.CornflowerBlue, LinearGradientMode.Horizontal) e.Graphics.FillPath(br, myPath) End Sub Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize Me.Button1.Invalidate() End Sub






Reply With Quote