A
ahmeddc
Guest
Use this class to draw a COMBOBOX and draw a sliding arrow from right to left. I want to reverse position and change left
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
Dim LGB As LinearGradientBrush
Dim GP As GraphicsPath
e.Graphics.Clear(BackColor)
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias
' Create a curvy border
GP = RoundRectangle.RoundRect(10, 0, Width - 1, Height - 1, 9) ' WIDTH OUT SDIDE
' Fills the body of the rectangle with a gradient
LGB = New LinearGradientBrush(ClientRectangle, Color.FromArgb(241, 241, 241), Color.FromArgb(241, 241, 241), 80.0F) 'تلوين قلب الكمبو
e.Graphics.SetClip(GP)
e.Graphics.FillRectangle(LGB, ClientRectangle)
e.Graphics.ResetClip()
' Draw rectangle border
e.Graphics.DrawPath(New Pen(New SolidBrush(_BORDERColor)), GP) 'COLOR OUT SDIDE
' Draw string
e.Graphics.DrawString(Text, Font, New SolidBrush(Color.FromArgb(142, 142, 142)), New Rectangle(3, 0, Width - 20, Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
' Draw the dropdown arrow The problem here
e.Graphics.DrawLine(New Pen(Color.FromArgb(160, 160, 160), 2), New Point(Width - 18, 10), New Point(Width - 14, 14))
e.Graphics.DrawLine(New Pen(Color.FromArgb(160, 160, 160), 2), New Point(Width - 14, 14), New Point(Width - 10, 10))
e.Graphics.DrawLine(New Pen(Color.FromArgb(160, 160, 160)), New Point(Width - 14, 15), New Point(Width - 14, 14))
GP.Dispose()
LGB.Dispose()
End Sub
Continue reading...
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
Dim LGB As LinearGradientBrush
Dim GP As GraphicsPath
e.Graphics.Clear(BackColor)
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias
' Create a curvy border
GP = RoundRectangle.RoundRect(10, 0, Width - 1, Height - 1, 9) ' WIDTH OUT SDIDE
' Fills the body of the rectangle with a gradient
LGB = New LinearGradientBrush(ClientRectangle, Color.FromArgb(241, 241, 241), Color.FromArgb(241, 241, 241), 80.0F) 'تلوين قلب الكمبو
e.Graphics.SetClip(GP)
e.Graphics.FillRectangle(LGB, ClientRectangle)
e.Graphics.ResetClip()
' Draw rectangle border
e.Graphics.DrawPath(New Pen(New SolidBrush(_BORDERColor)), GP) 'COLOR OUT SDIDE
' Draw string
e.Graphics.DrawString(Text, Font, New SolidBrush(Color.FromArgb(142, 142, 142)), New Rectangle(3, 0, Width - 20, Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
' Draw the dropdown arrow The problem here
e.Graphics.DrawLine(New Pen(Color.FromArgb(160, 160, 160), 2), New Point(Width - 18, 10), New Point(Width - 14, 14))
e.Graphics.DrawLine(New Pen(Color.FromArgb(160, 160, 160), 2), New Point(Width - 14, 14), New Point(Width - 10, 10))
e.Graphics.DrawLine(New Pen(Color.FromArgb(160, 160, 160)), New Point(Width - 14, 15), New Point(Width - 14, 14))
GP.Dispose()
LGB.Dispose()
End Sub
Continue reading...