Simple Visual Basic Tutorial - NotepadA VERY simple tutorial for a notepad in Visual Basic 2008 Express Edition that Opens, Saves and Clears text. Codes: Button1 (Open): Dim Open As New OpenFileDialog Open.Filter = "Text Files (*.txt)|*.txt|ALL FILES (*.*)|*.*" Open.Title = "Save File" Open.CheckPathExists = True Open.ShowDialog(Me) On Error Resume Next Dim RT As New System.IO.StreamReader(Open.FileName) On Error Resume Next TextBox1.Text = RT.ReadToEnd Button2 (Save): Dim Save As New SaveFileDialog Save.Filter = "Text Files (*.txt)|*.txt|ALL FILES (*.*)|*.*" Save.Title = "Save File" Save.CheckPathExists = True Save.ShowDialog(Me) Try My.Computer.FileSystem.WriteAllText(save.FileName, TextBox1.Text, False) Catch ex As Exception End Try Button3 (Clear): MsgBox("All text has been cleared!") TextBox1.Text = "" code pour embarquer la vidéo : >>> http://www.youtube.com/embed/xdsXswUNRlc <<< |