Public Class SelectionBoxForm
    Inherits Form

#Region " Designer "

    Public Sub New()
        MyBase.New()
        InitializeComponent()
    End Sub

    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    Private components As System.ComponentModel.IContainer

    Friend WithEvents bCancel As System.Windows.Forms.Button
    Public WithEvents bOK As System.Windows.Forms.Button
    Public WithEvents lText As System.Windows.Forms.Label
    Friend WithEvents SmartTagProvider As Stax.UI.Design.SmartTagProvider
    Public WithEvents cbItems As System.Windows.Forms.ComboBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.lText = New System.Windows.Forms.Label
        Me.bCancel = New System.Windows.Forms.Button
        Me.bOK = New System.Windows.Forms.Button
        Me.cbItems = New System.Windows.Forms.ComboBox
        Me.SmartTagProvider = New Stax.UI.Design.SmartTagProvider
        Me.SuspendLayout()
        '
        'lText
        '
        Me.lText.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.lText.Location = New System.Drawing.Point(13, 8)
        Me.lText.Name = "lText"
        Me.lText.Size = New System.Drawing.Size(269, 32)
        Me.lText.TabIndex = 0
        Me.lText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'bCancel
        '
        Me.bCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.bCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.bCancel.FlatStyle = System.Windows.Forms.FlatStyle.System
        Me.bCancel.Location = New System.Drawing.Point(207, 72)
        Me.bCancel.Name = "bCancel"
        Me.bCancel.Size = New System.Drawing.Size(75, 24)
        Me.bCancel.TabIndex = 3
        Me.bCancel.Text = "Cancel"
        '
        'bOK
        '
        Me.bOK.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.bOK.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.bOK.FlatStyle = System.Windows.Forms.FlatStyle.System
        Me.bOK.Location = New System.Drawing.Point(126, 72)
        Me.bOK.Name = "bOK"
        Me.bOK.Size = New System.Drawing.Size(75, 24)
        Me.bOK.TabIndex = 2
        Me.bOK.Text = "OK"
        '
        'cbItems
        '
        Me.cbItems.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.cbItems.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cbItems.FormattingEnabled = True
        Me.cbItems.Location = New System.Drawing.Point(13, 44)
        Me.cbItems.MaxDropDownItems = 20
        Me.cbItems.Name = "cbItems"
        Me.cbItems.Size = New System.Drawing.Size(269, 21)
        Me.cbItems.TabIndex = 1
        '
        'SelectionBoxForm
        '
        Me.ClientSize = New System.Drawing.Size(294, 108)
        Me.Controls.Add(Me.cbItems)
        Me.Controls.Add(Me.bOK)
        Me.Controls.Add(Me.bCancel)
        Me.Controls.Add(Me.lText)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "SelectionBoxForm"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private ReturnValueValue As Object

    Public Property ReturnValue() As Object
        Get
            Return ReturnValueValue
        End Get
        Set(ByVal value As Object)
            ReturnValueValue = value
        End Set
    End Property

    Private Sub lText_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles lText.TextChanged
        Dim g As Graphics = lText.CreateGraphics
        Dim s As SizeF = g.MeasureString(lText.Text, lText.Font, lText.Width)
        g.Dispose()

        If s.Height > lText.Height Then
            Height += CInt(s.Height - lText.Height)
        End If
    End Sub
End Class