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 MainMenu1 As System.Windows.Forms.MainMenu
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem7 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem8 As System.Windows.Forms.MenuItem
Friend WithEvents ToolBar1 As System.Windows.Forms.ToolBar
Friend WithEvents ToolBarButton1 As
System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton2 As
System.Windows.Forms.ToolBarButton
Friend WithEvents StatusBar1 As System.Windows.Forms.StatusBar
Friend WithEvents StatusBarPanel1 As
System.Windows.Forms.StatusBarPanel
Friend WithEvents StatusBarPanel2 As
System.Windows.Forms.StatusBarPanel
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu()
Me.MenuItem1 = New System.Windows.Forms.MenuItem()
Me.MenuItem2 = New System.Windows.Forms.MenuItem()
Me.MenuItem3 = New System.Windows.Forms.MenuItem()
Me.MenuItem4 = New System.Windows.Forms.MenuItem()
Me.MenuItem5 = New System.Windows.Forms.MenuItem()
Me.MenuItem6 = New System.Windows.Forms.MenuItem()
Me.MenuItem7 = New System.Windows.Forms.MenuItem()
Me.MenuItem8 = New System.Windows.Forms.MenuItem()
Me.ToolBar1 = New System.Windows.Forms.ToolBar()
Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton()
Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton()
Me.StatusBar1 = New System.Windows.Forms.StatusBar()
Me.StatusBarPanel1 = New System.Windows.Forms.StatusBarPanel()
Me.StatusBarPanel2 = New System.Windows.Forms.StatusBarPanel()
Me.TextBox1 = New System.Windows.Forms.TextBox()
CType(Me.StatusBarPanel1,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.StatusBarPanel2,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'MainMenu1
'
Me.MainMenu1.MenuItems.AddRange(New
System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem6})
'
'MenuItem1
'
Me.MenuItem1.Index = 0
Me.MenuItem1.MenuItems.AddRange(New
System.Windows.Forms.MenuItem() {Me.MenuItem2, Me.MenuItem3,
Me.MenuItem4, Me.MenuItem5})
Me.MenuItem1.Text = "&File"
'
'MenuItem2
'
Me.MenuItem2.Index = 0
Me.MenuItem2.Shortcut = System.Windows.Forms.Shortcut.CtrlN
Me.MenuItem2.Text = "New"
'
'MenuItem3
'
Me.MenuItem3.Index = 1
Me.MenuItem3.Shortcut = System.Windows.Forms.Shortcut.CtrlO
Me.MenuItem3.Text = "&Open"
'
'MenuItem4
'
Me.MenuItem4.Index = 2
Me.MenuItem4.Shortcut = System.Windows.Forms.Shortcut.CtrlS
Me.MenuItem4.Text = "&Save"
'
'MenuItem5
'
Me.MenuItem5.Index = 3
Me.MenuItem5.Text = "Save &as.."
'
'MenuItem6
'
Me.MenuItem6.Index = 1
Me.MenuItem6.MenuItems.AddRange(New
System.Windows.Forms.MenuItem() {Me.MenuItem7, Me.MenuItem8})
Me.MenuItem6.Shortcut = System.Windows.Forms.Shortcut.CtrlE
Me.MenuItem6.Text = "&Edit"
'
'MenuItem7
'
Me.MenuItem7.Index = 0
Me.MenuItem7.Text = "Undo"
'
'MenuItem8
'
Me.MenuItem8.Index = 1
Me.MenuItem8.Text = "Redo"
'
'ToolBar1
'
Me.ToolBar1.Buttons.AddRange(New
System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1,
Me.ToolBarButton2})
Me.ToolBar1.DropDownArrows = True
Me.ToolBar1.Name = "ToolBar1"
Me.ToolBar1.ShowToolTips = True
Me.ToolBar1.Size = New System.Drawing.Size(292, 39)
Me.ToolBar1.TabIndex = 0
'
'ToolBarButton1
'
Me.ToolBarButton1.Text = "new"
'
'ToolBarButton2
'
Me.ToolBarButton2.Text = "open"
'
'StatusBar1
'
Me.StatusBar1.Location = New System.Drawing.Point(0, 244)
Me.StatusBar1.Name = "StatusBar1"
Me.StatusBar1.Panels.AddRange(New
System.Windows.Forms.StatusBarPanel() {Me.StatusBarPanel1,
Me.StatusBarPanel2})
Me.StatusBar1.ShowPanels = True
Me.StatusBar1.Size = New System.Drawing.Size(292, 22)
Me.StatusBar1.TabIndex = 1
Me.StatusBar1.Text = "StatusBar1"
'
'StatusBarPanel1
'
Me.StatusBarPanel1.AutoSize =
System.Windows.Forms.StatusBarPanelAutoSize.Spring
Me.StatusBarPanel1.Text = "StatusBarPanel1"
Me.StatusBarPanel1.Width = 177
'
'StatusBarPanel2
'
Me.StatusBarPanel2.AutoSize =
System.Windows.Forms.StatusBarPanelAutoSize.Contents
Me.StatusBarPanel2.Text = "StatusBarPanel2"
Me.StatusBarPanel2.Width = 99
'
'TextBox1
'
Me.TextBox1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TextBox1.Location = New System.Drawing.Point(0, 39)
Me.TextBox1.Multiline = True
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(292, 205)
Me.TextBox1.TabIndex = 2
Me.TextBox1.Text = "TextBox1"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.AddRange(New System.Windows.Forms.Control()
{Me.TextBox1, Me.StatusBar1, Me.ToolBar1})
Me.Menu = Me.MainMenu1
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.StatusBarPanel1,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.StatusBarPanel2,
System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Dim fs As FileStream
Dim sw As StreamWriter
Dim sr As StreamReader
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles
ToolBar1.ButtonClick
fs = New FileStream("Z:\swaroop\t1sm3\mdi_application\Notepad-
MDI\datanoneed\swaroop-rockz.txt", FileMode.Create)
End Sub
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MenuItem3.Click
fs = New FileStream("Z:\swaroop\t1sm3\mdi_application\Notepad-
MDI\datanoneed\swaroop-rockz.txt", FileMode.Open, FileAccess.Read)
sr = New StreamReader(fs)
TextBox1.Text = sr.ReadLine()
sr.Close()
fs.Close()
End Sub
Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MenuItem4.Click
sw = New StreamWriter(fs)
sw.Write(TextBox1.Text)
sw.Close()
fs.Close()
End Sub
End Class