-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm3.vb
201 lines (173 loc) · 7.83 KB
/
Form3.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
Imports System.IO
Public Class Form3
Dim drag As Boolean = False
Dim mousex As Integer, mousey As Integer
Dim use As Long
Dim ck As Long
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
drag = True
mousex = Windows.Forms.Cursor.Position.X - Me.Left
mousey = Windows.Forms.Cursor.Position.Y - Me.Top
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If drag Then
Me.Left = Windows.Forms.Cursor.Position.X - mousex
Me.Top = Windows.Forms.Cursor.Position.Y - mousey
End If
End Sub
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
drag = False
End Sub
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
drag = True
mousex = Windows.Forms.Cursor.Position.X - Me.Left
mousey = Windows.Forms.Cursor.Position.Y - Me.Top
End Sub
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
If drag Then
Me.Left = Windows.Forms.Cursor.Position.X - mousex
Me.Top = Windows.Forms.Cursor.Position.Y - mousey
End If
End Sub
Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
drag = False
End Sub
Private Sub PictureBox2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox2.MouseDown
drag = True
mousex = Windows.Forms.Cursor.Position.X - Me.Left
mousey = Windows.Forms.Cursor.Position.Y - Me.Top
End Sub
Private Sub PictureBox2_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox2.MouseMove
If drag Then
Me.Left = Windows.Forms.Cursor.Position.X - mousex
Me.Top = Windows.Forms.Cursor.Position.Y - mousey
End If
End Sub
Private Sub PictureBox2_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox2.MouseUp
drag = False
End Sub
Private Sub Panel3_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel3.MouseDown
drag = True
mousex = Windows.Forms.Cursor.Position.X - Me.Left
mousey = Windows.Forms.Cursor.Position.Y - Me.Top
End Sub
Private Sub Panel3_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel3.MouseMove
If drag Then
Me.Left = Windows.Forms.Cursor.Position.X - mousex
Me.Top = Windows.Forms.Cursor.Position.Y - mousey
End If
End Sub
Private Sub Panel3_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel3.MouseUp
drag = False
End Sub
Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label9.Click
Me.Close()
Form1.Close()
End Sub
Private Sub Label29_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label29.Click
Me.WindowState = FormWindowState.Minimized
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form8.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ck = 0
If use Mod 2 = 0 Then
' My.Settings.User = TextBox1.Text
' My.Settings.Pass = TextBox2.Text
End If
If use Mod 2 = 1 Then
My.Settings.User = TextBox1.Text
My.Settings.Pass = TextBox2.Text
End If
Dim check_t2 As String = TextBox2.Text
If File.Exists(".\users\" + TextBox1.Text + ".txt") Then
If TextBox2.Text = System.IO.File.ReadAllText(".\users\" + TextBox1.Text + ".txt") Then
check_t2 = check_t2.ToLower()
Dim b As Boolean = check_t2.Contains("zixmar")
If b = True Then
Form1.Label31.Text = TextBox1.Text
Else
Form1.Label31.Text = TextBox1.Text + "." + TextBox2.Text
End If
Me.Close()
Form1.TabControl1.Show()
Form1.Panel1.Show()
Form1.Label29.Show()
Form1.Label9.Show()
Form1.WindowState = FormWindowState.Normal
Form1.Enabled = True
Form1.Opacity = 100
ck = 1
End If
End If
If TextBox1.Text = vbNullString Or TextBox2.Text = vbNullString Then
ck = 1
Label3.Text = "You have not specified a valid username or password ..."
End If
If Not ck = 1 Then
Label3.Text = "your username or password can't sign ..."
End If
End Sub
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'PictureBox3.Hide()
ck = 0
Me.CheckBox1.Checked = My.Settings.chk6
If use Mod 2 = 0 Then
' My.Settings.User = TextBox1.Text
' My.Settings.Pass = TextBox2.Text
End If
If use Mod 2 = 1 Then
TextBox1.Text = My.Settings.User
TextBox2.Text = My.Settings.Pass
End If
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
#If use = 0 Then
use = use + 1
#End If
My.Settings.chk6 = Me.CheckBox1.CheckState
End Sub
Private Sub TextBox1_MouseDown(sender As Object, e As MouseEventArgs) Handles TextBox1.MouseDown
Label3.Text = "Input your username ..."
End Sub
Private Sub TextBox1_MouseHover(sender As Object, e As EventArgs) Handles TextBox1.MouseHover
If TextBox1.Text = "" Then
Label3.Text = "Input your username ..."
End If
End Sub
Private Sub TextBox2_MouseDown(sender As Object, e As MouseEventArgs) Handles TextBox2.MouseDown
Label3.Text = "Input your password ..."
End Sub
Private Sub TextBox2_MouseHover(sender As Object, e As EventArgs) Handles TextBox2.MouseHover
If TextBox2.Text = "" Then
Label3.Text = "Input your password ..."
End If
End Sub
Private Sub TextBox2_MouseLeave(sender As Object, e As EventArgs) Handles TextBox2.MouseLeave
Label3.Text = ""
End Sub
Private Sub TextBox1_MouseLeave(sender As Object, e As EventArgs) Handles TextBox1.MouseLeave
Label3.Text = ""
End Sub
Private Sub Button1_MouseHover(sender As Object, e As EventArgs) Handles Button1.MouseHover
Label3.Text = "Exit ..."
End Sub
Private Sub Panel3_Paint(sender As Object, e As PaintEventArgs) Handles Panel3.Paint
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Form1.Label31.Text = "Guest"
Me.Close()
Form1.TabControl1.Show()
Form1.Panel1.Show()
Form1.Label29.Show()
Form1.Label9.Show()
Form1.WindowState = FormWindowState.Normal
Form1.Enabled = True
Form1.Opacity = 100
ck = 1
End Sub
Private Sub Button1_MouseLeave(sender As Object, e As EventArgs) Handles Button1.MouseLeave
Label3.Text = ""
End Sub
End Class