VB 2008 on my side! I tried 2010 but for some reason the IDE is very unstable (crashes all the time)!
One last thing, if it's not too much trouble! Overriding the OnPaint in my control doesn't do jack, i.e, my control doesn't paint! I tried in both the control and the base control, still nada.Any advice?
Code:
'A Label Control with graphical effects
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.ComponentModel
<ToolboxItem(True)> _
Public Class GLabel
Inherits BaseControl
#Region "Painting"
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(e)
'Painting the control
Dim rc As New Rectangle(0, 0, Width - 1, Height - 1)
'Paint the border
PaintBorder(e.Graphics, rc, BorderColor, BorderStyle, BorderSides)
End Sub
#End Region
End Class The BorderStyle is Enum, the BorderSides is a structure (will write the UITypeConverter later)
EDIT: Sorry, I;ve got it! Haven't initialize the structure in the designer! My bad!
Bookmarks