Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » VB.NET » General » Downloads
 
Add your own
alternative version
Go to top

GN Wizard Framework

, 21 Dec 2006
A simple Wizard framework.
gnwizard.zip
Copy of GN Wizard
GNWizard
About
About Box
bin
GNWizardFrameWork.dll
Controls
Designer
GNWizardFrameWork.vbproj.user
Panels And Collections
Resources
GNWizardFrameWork.WizardPage.bmp
GNWizardFrameWork.WizardTemplate.bmp
WizardBanner.jpg
GNWizard Framework .chm
Test
Test
bin
GNWizardFrameWork.dll
Test.exe
licenses.licx
Test.vbproj.user
Imports System.Drawing
Imports System.Windows.Forms

Namespace GNWizardFrameWork
    ''' -----------------------------------------------------------------------------
    ''' Project	 : GNWizardFrameWork
    ''' Class	 : ThreeDLine
    ''' 
    ''' -----------------------------------------------------------------------------
    ''' <summary>
    ''' Simple 3D Line control
    ''' </summary>
    ''' <remarks>
    ''' </remarks>
    ''' <history>
    ''' 	[G_Noble]	21/03/2006	Created
    ''' </history>
    ''' -----------------------------------------------------------------------------
    Friend Class ThreeDLine
        Inherits System.Windows.Forms.UserControl
        Dim m_iSpacing As Integer
        Dim m_borderStyle As Border3DStyle = Border3DStyle.Etched

        <System.ComponentModel.Category("Appearance")> _
      Public Property HeaderText() As String
            Get
                Return Text
            End Get
            Set(ByVal Value As String)
                Text = Value
                Me.Invalidate()

            End Set
        End Property

        <System.ComponentModel.Category("Appearance")> _
        Public Property LineStyle() As Border3DStyle
            Get
                Return m_borderStyle
            End Get
            Set(ByVal Value As Border3DStyle)
                If Value <> m_borderStyle Then
                    m_borderStyle = Value
                    Me.Invalidate()
                End If
            End Set
        End Property
        <System.ComponentModel.Category("Appearance")> _
        Public Property Spacing() As Integer
            Get
                Return m_iSpacing
            End Get
            Set(ByVal Value As Integer)
                If Value <> m_iSpacing Then
                    m_iSpacing = Value
                    Me.Invalidate()
                End If
            End Set
        End Property
        Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
            Dim g As Graphics = e.Graphics
            Dim f As Font = Me.Font
            Dim b As Brush = New SolidBrush(Me.ForeColor)
            Dim sf As StringFormat = StringFormat.GenericTypographic
            Dim labelBounds As New RectangleF(0, 0, Me.Width, Me.Height)
            Dim textSize As SizeF = g.MeasureString(Me.Text, f, Me.Width)
            g.DrawString(Me.Text, f, b, 0, 0, sf)
            If textSize.Width + Spacing < Me.Width Then
                Dim startingPoint As Point
                startingPoint.X = textSize.Width + Spacing
                startingPoint.Y = textSize.Height \ 2
                ControlPaint.DrawBorder3D(g, startingPoint.X, _
                startingPoint.Y, _
                 Me.Width - startingPoint.X, _
                 5, m_borderStyle, Border3DSide.Top)
            End If
        End Sub
        Public Sub New()
            Me.SetStyle(ControlStyles.DoubleBuffer, True)
            Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
            Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
            Me.SetStyle(ControlStyles.ResizeRedraw, True)
            updatestyles()
        End Sub

        Private Sub InitializeComponent()
            '
            'ThreeDLine
            '
            Me.Name = "ThreeDLine"
            Me.Size = New System.Drawing.Size(150, 16)

        End Sub
    End Class

End Namespace

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Gary Noble
Software Developer
United Kingdom United Kingdom
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.140905.1 | Last Updated 21 Dec 2006
Article Copyright 2006 by Gary Noble
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid