Use vb to create the login screen?
1, on the desktop, the left mouse button double-click the program, open the VB programming software, in the left toolbar, click the [Label] button, in the Form1 window to draw two labels, used to write the text of the instructions. Write the user name and password here, as shown below.
2, then, according to the size of the window, the feeling that the text is small, you can Label Properties window, modify the value of the Font attribute, click on its selection button to change the size of the font, as shown below.
3, then, in the pop-up Font dialog box, select the size of the four characters, click [OK] button, you can see the Form1 window on the user name font size. Password font size is also the same operation, as shown in the figure below.
4, then, in the program on the left toolbar, click the [TextBox] button, in the Form1 window to draw two text boxes, and in the TextBox Properties panel, modify the value of Text, will be empty, as shown below.
5, then, in the program on the left toolbar, click the [CommandButton] button in the Form1 window to draw two command buttons in its Properties panel, the value of the Caption is changed to OK. The other changed to Cancel, as shown below.
6, finally, in the program on the left toolbar, click the [Image] button, in the Form1 window on the drawing of the two picture frames, and modify the value of its two attributes, as shown in the figure below, after selecting the two icons, will be re-layout them to look better after the click to run, the log-in window appeared, as shown in the figure below.
1, create a new standard project, add two forms in the form, use the default name (here the default can be changed), the first form caption attribute changed to “user login”, the second window caption attribute changed to ” “space, in the first window to add two label control, the name were changed to “user name:” “password” (here the right attribute table passwordchar to add) “*”) borderstyle were selected 3, two commandbox space, caption attribute were changed to “login” “exit” < /p>
The main program to add, here code in the picture
2, in the second window to add two labels, a commandbox control, label’s caption attribute were changed to “user successfully logged in, welcome to use”, “”. Statement: Purely for personal enjoyment and learning, do not use commercially”; commandboxe control caption attribute changed to “exit” the main code in the picture
3, click on the menu bar “Launch “Input” user name “” password “, you can log in, log in interface is so finished, it is very simple, I hope you more speculation, the development of a better program
VB design a login (registration) interface
VB design a login (registration) interface
Copy the following code into Form1.frm and open Form1.frm with vb.
‘Code Start
VERSION
5.00
Begin
VB. Form
Form1
Caption
=
“Form1”
ClientHeight
=
1260
ClientLeft
=
60
ClientTop
=
345
ClientWidth
=
4065
LinkTopic
=
=
“Form1”
ScaleHeight
=<
1260
ScaleWidth
=
4065
StartUpPosition
=
3
‘Window Default
Begin
VB. CommandButton
C1
Caption
=
‘OK’
Height
=
495
Left
=
960
TabIndex
=
2
Top
=
480
Width
=
1815
End
Begin
VB. Height
=
270
Left
=
840
TabIndex
=
0
Top
=
120
Width
=
2895
End
Begin
VB. p>=
1
‘Fixed
Single
Caption
=
“Account number:”
Height
=
240
Left
=
120
TabIndex
=
1
Top
=
120
Width
=
600
End
End
Attribute
VB_Name
=
“Form1”
Attribute
VB_GlobalNameSpace
=
False
Attribute
VB_Creatable
=
False
Attribute
VB_PredeclaredId
=
True
Attribute
VB_Exposed
=
False
Private
Sub
C1_Click()
Static
num
As
Integer
‘Define static variable storing count
If
T1<
=
“abcd”
Then
‘Assume account number is abcd
MsgBox
“Login successful”
End
ElseIf
num
=
3
–
1
Then
MsgBox
“You are not authorized to use this system”
End
Else
MsgBox
“Account number error, try again”
num
=
num
+
1
End
If
End
Sub
‘End of code’