End Sub
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles btnDelete.Click
Dim strBlock As String
strBlock = Me.lstBloecke.SelectedItem
Dim fso As New Scripting.FileSystemObject()
Dim strPath As String
strPath = "C:\Programme\Crox Corporation\SystrayTB\Notices\" & strBlock
Dim result As MsgBoxResult
result = MsgBox("Möchten Sie diesen Notizblock wirklich löschen? (" & _
strBlock & ")", MsgBoxStyle.YesNo, "Löschen bestätigen")
If result = MsgBoxResult.Yes Then
fso.DeleteFolder(strPath, True)
result = MsgBox("Der Notizblock " & strBlock & " wurde erfolgreich" & _
"gelöscht.", MsgBoxStyle.Exclamation, "Löschen erfolgreich")
Me.lstBloecke.Items.Remove(strBlock)
Me.tab.TabPages.Clear()
Me.btnDelNotice.Enabled = False
Me.btnRenNotice.Enabled = False
Me.btnNewNotice.Enabled = False
Else
result = MsgBox("Der Löschvorgang wurde abgebrochen.", _
MsgBoxStyle.Information, "Abgebrochen")
End If
End Sub
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles btnNew.Click
Dim fso As New Scripting.FileSystemObject()
Dim strPath As String
strPath = "C:\Programme\Crox Corporation\SystrayTB\Notices\"
Dim strBlock As String
strBlock = InputBox("Wie soll der neue Notizblock heissen?", "Neuer" & _
"Notizblock", "NeuerNotizblock1")
Dim result As MsgBoxResult
result = MsgBox("Möchten Sie den Notizblock, " & strBlock & ", wirklich" & _
"erstellen?", MsgBoxStyle.YesNo, "Neuer Notizblock")
If result = MsgBoxResult.Yes Then
On Error GoTo InvalidName
fso.CreateFolder(strPath & strBlock)
Me.lstBloecke.Items.Add(strBlock)
Me.lstBloecke.SelectedItem = strBlock
Else
result = MsgBox("Die Erstellung des Notizblockes " & strBlock & "" & _
"wurde abgebrochen.", MsgBoxStyle.Information, "Abbruch")
End If
Exit Sub
InvalidName:
result = MsgBox("Sie haben einen ungültigen Namen für den Notizblock" & _
"eingegeben." & vbCrLf & "Folgende Zeichem sind nicht erlaubt:" & _
"<>|'\/?" & Chr(34) & ":", MsgBoxStyle.Critical, "Ungültiger" & _
"Notizblock-Name")
End Sub
Private Sub btnNewNotice_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles btnNewNotice.Click
Dim strNotice As String
strNotice = InputBox("Welchen Namen soll Ihre neue Notiz erhalten?", _
"Neue Notiz", "NeueNotiz1")
Dim TabPage As System.Windows.Forms.TabPage
TabPage = New System.Windows.Forms.TabPage()
Dim TextBox As System.Windows.Forms.TextBox
TextBox = New System.Windows.Forms.TextBox()
Dim strBlock As String |