Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()
        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    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

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents MyControl1 As Controls.MyControl
    Friend WithEvents btnReset As System.Windows.Forms.Button
    Friend WithEvents btnOpenFile As Controls.FileButton
    Friend WithEvents txtFileName As System.Windows.Forms.TextBox
    Friend WithEvents TickButton1 As Controls.TickButton
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.MyControl1 = New Controls.MyControl()
        Me.btnReset = New System.Windows.Forms.Button()
        Me.btnOpenFile = New Controls.FileButton()
        Me.txtFileName = New System.Windows.Forms.TextBox()
        Me.TickButton1 = New Controls.TickButton()
        Me.SuspendLayout()
        '
        'MyControl1
        '
        Me.MyControl1.Location = New System.Drawing.Point(8, 8)
        Me.MyControl1.MessageText = "Hello, world!"
        Me.MyControl1.Name = "MyControl1"
        Me.MyControl1.Size = New System.Drawing.Size(152, 104)
        Me.MyControl1.TabIndex = 0
        '
        'btnReset
        '
        Me.btnReset.Location = New System.Drawing.Point(160, 16)
        Me.btnReset.Name = "btnReset"
        Me.btnReset.TabIndex = 1
        Me.btnReset.Text = "Reset"
        '
        'btnOpenFile
        '
        Me.btnOpenFile.BuddyBoxName = "txtFileName"
        Me.btnOpenFile.Location = New System.Drawing.Point(160, 160)
        Me.btnOpenFile.Name = "btnOpenFile"
        Me.btnOpenFile.Size = New System.Drawing.Size(72, 23)
        Me.btnOpenFile.TabIndex = 2
        Me.btnOpenFile.Text = "Open"
        '
        'txtFileName
        '
        Me.txtFileName.Location = New System.Drawing.Point(16, 160)
        Me.txtFileName.Name = "txtFileName"
        Me.txtFileName.Size = New System.Drawing.Size(136, 20)
        Me.txtFileName.TabIndex = 3
        Me.txtFileName.Text = "c:\hello.txt"
        '
        'TickButton1
        '
        Me.TickButton1.Location = New System.Drawing.Point(16, 120)
        Me.TickButton1.Name = "TickButton1"
        Me.TickButton1.Size = New System.Drawing.Size(216, 23)
        Me.TickButton1.TabIndex = 4
        Me.TickButton1.Text = "Design Mode"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(240, 189)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.TickButton1, Me.txtFileName, Me.btnOpenFile, Me.btnReset, Me.MyControl1})
        Me.Name = "Form1"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
        MyControl1.ResetMessageText()
    End Sub

    Private Sub MyControl1_HelloWorld(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyControl1.HelloWorld
        MyControl1.ResetMessageText()
    End Sub

    Private Sub btnOpenFile_OpenFile(ByVal sender As Object, ByVal e As Controls.OpenFileEventArgs) Handles btnOpenFile.OpenFile
        MsgBox(e.FileText)
    End Sub
End Class
