Imports System.Object
Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
#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)
MyBase.Dispose(disposing)
End Sub
'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 tbmain As System.Windows.Forms.TextBox
Private Sub InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu()
Me.tbmain = New System.Windows.Forms.TextBox()
Me.Button1 = New System.Windows.Forms.Button()
'
'tbmain
'
Me.tbmain.Location = New System.Drawing.Point(24, 32)
Me.tbmain.Multiline = True
Me.tbmain.Size = New System.Drawing.Size(192, 128)
Me.tbmain.Text = "TextBox1"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(112, 200)
Me.Button1.Size = New System.Drawing.Size(104, 40)
Me.Button1.Text = "Button1"
'
'Form1
'
Me.ClientSize = New System.Drawing.Size(240, 270)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.tbmain)
Me.Menu = Me.MainMenu1
Me.Text = "Form1"
End Sub
Public Shared Sub Main()
Application.Run(New Form1())
Directory.CreateDirectory("D:\Louis\Misc\listing.txt")
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sIn As StreamReader
Dim cLine As String
Dim bDone As Boolean = False
Dim din As StreamReader = File.OpenText("D:\Louis\misc\listing.txt")
Try
While Not bDone
cLine = sIn.ReadLine()
If cLine Is Nothing Then
bDone = True
Else
tbmain.Text = tbmain.Text & cLine
End If
End While
Finally
sIn.Close()
End Try
End Sub
End Class