-
Notifications
You must be signed in to change notification settings - Fork 0
/
UC_Verteiler.vb
59 lines (42 loc) · 2.58 KB
/
UC_Verteiler.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Public Class UC_Verteiler
Public ndVerteilerNr As XmlNode
Public bLoad As Boolean
Private Sub UC_Verteiler_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
bLoad = True
Me.TB_Empfaenger.Text = ndVerteilerNr.Attributes("Empfaenger").Value
'Me.Label_Verteiler.Text = "Verteiler " & Me.Parent.Controls.Count - Me.Parent.Controls.GetChildIndex(Me)
bLoad = False
End Sub
Private Sub TB_Empfaenger_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TB_Empfaenger.TextChanged
Dim iCursorPos As Integer = Me.TB_Empfaenger.SelectionStart
If iCursorPos > 1 Then
Dim strZeichen As String = Microsoft.VisualBasic.Mid(Me.TB_Empfaenger.Text, iCursorPos, 1)
If Microsoft.VisualBasic.Mid(Me.TB_Empfaenger.Text, iCursorPos, 1) = ";" Then
Me.TB_Empfaenger.Text = Me.TB_Empfaenger.Text.Insert(iCursorPos, "" & Chr(13) & Chr(10) & "")
Me.TB_Empfaenger.SelectionStart = iCursorPos + 2
ElseIf Microsoft.VisualBasic.Mid(Me.TB_Empfaenger.Text, iCursorPos - 1, 1) = ";" Then
Me.TB_Empfaenger.Text = Me.TB_Empfaenger.Text.Insert(iCursorPos - 1, "" & Chr(13) & Chr(10) & "")
Me.TB_Empfaenger.SelectionStart = iCursorPos + 2
End If
End If
If bLoad = False Then
ndVerteilerNr.Attributes("Empfaenger").Value = Me.TB_Empfaenger.Text
Dim iVNr As Integer = Me.Label_Verteiler.Text.Replace("Verteiler ", "") - 1
ndAllgemein.Item("Verteiler").ChildNodes(iVNr).Attributes("Empfaenger").Value = Me.TB_Empfaenger.Text
Dim tmpNd As XmlNode = ndAllgemein
End If
End Sub
'Private Sub TB_Empfaenger_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TB_Empfaenger.Validating
' ndVerteilerNr.Attributes("Empfaenger").Value = Me.TB_Empfaenger.Text
' 'Daten_Allgemein_Speichern()
'End Sub
Private Sub Button_Remove_Verteiler_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Remove_Verteiler.Click
Dim iVNr As Integer = Me.Label_Verteiler.Text.Replace("Verteiler ", "") - 1
ndAllgemein.Item("Verteiler").RemoveChild(ndAllgemein.Item("Verteiler").ChildNodes(iVNr))
Dim ctr As Control = Me.Parent
Do Until TypeOf (ctr) Is UserControl_Einstellungen
ctr = ctr.Parent
Loop
If TypeOf (ctr) Is UserControl_Einstellungen Then CType(ctr, UserControl_Einstellungen).Update_Verteiler()
End Sub
End Class