?? form1.frm
字號(hào):
VERSION 5.00
Begin VB.Form Form1
Caption = "注冊(cè)"
ClientHeight = 2310
ClientLeft = 60
ClientTop = 450
ClientWidth = 7305
LinkTopic = "Form1"
ScaleHeight = 2310
ScaleWidth = 7305
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command7
Caption = "校驗(yàn)碼"
Height = 375
Left = 3720
TabIndex = 11
Top = 1200
Width = 1335
End
Begin VB.TextBox Text5
Height = 495
Left = 720
TabIndex = 10
Top = 1080
Width = 2775
End
Begin VB.CommandButton Command6
Caption = "取注冊(cè)碼"
Height = 495
Left = 6240
TabIndex = 9
Top = 3480
Visible = 0 'False
Width = 1335
End
Begin VB.TextBox Text4
Height = 375
Left = 720
TabIndex = 8
Top = 480
Width = 2775
End
Begin VB.TextBox Text3
Height = 375
Left = 1560
TabIndex = 7
Text = "Text3"
Top = 4080
Visible = 0 'False
Width = 1335
End
Begin VB.CommandButton Command5
Caption = "Command5"
Height = 495
Left = 600
TabIndex = 6
Top = 4560
Visible = 0 'False
Width = 1575
End
Begin VB.TextBox Text2
Height = 375
Left = 120
TabIndex = 5
Text = "Text2"
Top = 4080
Visible = 0 'False
Width = 1335
End
Begin VB.CommandButton Command4
Caption = "產(chǎn)生隨機(jī)數(shù)"
Height = 375
Left = 720
TabIndex = 4
Top = 3360
Visible = 0 'False
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "刪除"
Height = 375
Left = 5280
TabIndex = 3
Top = 1680
Width = 1935
End
Begin VB.CommandButton Command2
Caption = "讀"
Height = 495
Left = 5280
TabIndex = 2
Top = 840
Width = 1935
End
Begin VB.CommandButton Command1
Caption = "寫入注冊(cè)表"
Height = 375
Left = 3360
TabIndex = 1
Top = 2760
Visible = 0 'False
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Left = 600
TabIndex = 0
Text = "Text1"
Top = 2640
Visible = 0 'False
Width = 1935
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
SaveSetting "MyApp", "User", "Name", Text1
'SaveSetting "MyApp", "User", "Company", Text2
MsgBox "您的信息已成功保存!"
End Sub
'新建一個(gè)窗體,在窗體里添加三個(gè)按鈕,兩個(gè)文本輸入框,完成后打開(kāi)代碼窗口,
'將以下內(nèi)容填入對(duì)應(yīng)代碼段里,運(yùn)行就可以操作注冊(cè)表了。
'Private Sub cmdSave_Click() '這是添加注冊(cè)表項(xiàng)的代碼
'
' '將兩個(gè)文本框中的內(nèi)容分別賦給MyApp下User區(qū)中Name和Company
' SaveSetting "MyApp", "User", "Name", txtName
' SaveSetting "MyApp", "User", "Company", txtCompany
' MsgBox "您的信息已成功保存!"
'
'End Sub
'
'Private Sub cmdFind_Click() '這是查找并顯示注冊(cè)表項(xiàng)的代碼
'
' '查找MyApp下User區(qū)中Name和Company的設(shè)置值并顯示
' If GetSetting("MyApp", "User", "Name") = "" Then
' MsgBox "在注冊(cè)表中未找到該項(xiàng)內(nèi)容!"
' Else
' MsgBox "您的姓名是:" & GetSetting("MyApp", "User", "Name") & Chr(13) & Chr(10) & _
' "您的公司是:" & GetSetting("MyApp", "User", "Company")
' End If
'End Sub
'
'Private Sub cmdDelete_Click() '這是刪除注冊(cè)表項(xiàng)的代碼
'
' '刪除MyApp下的User區(qū)域及其下的所有注冊(cè)表項(xiàng)
' DeleteSetting "MyApp", "User"
' MsgBox "該項(xiàng)設(shè)置已刪除。"
'
'End Sub
'
Private Sub Command2_Click()
If GetSetting("MyApp", "User", "Name") = "" Then
MsgBox "在注冊(cè)表中未找到該項(xiàng)內(nèi)容!"
Else
MsgBox "您的姓名是:" & GetSetting("MyApp", "User", "Name")
End If
End Sub
Private Sub Command3_Click()
DeleteSetting "MyApp", "User"
MsgBox "該項(xiàng)設(shè)置已刪除。"
End Sub
Private Sub Command4_Click()
Text1.Text = Int(Rnd() * (999999 - 100000 + 1) + 100000)
End Sub
Private Sub Command5_Click()
Text2.Text = Hex(Val(Text1.Text))
Text3.Text = Oct(Val(Text1.Text))
End Sub
Private Sub Command6_Click()
Dim str1
Dim str2
Dim str3
Dim lstr
Dim a As Date
a = Time
lstr = Right(a, 1) + 1
Text5.Text = lstr
str1 = Left((Int(Rnd() * (999 - 100 + 1) + 100)) * lstr, 3)
str2 = Left((Int(Rnd() * (999 - 100 + 1) + 100)) * lstr, 3)
str2 = Hex(Val(str2))
Select Case Len(str2)
Case 1
str2 = str2 + "00"
Case 2
str2 = str2 + "0"
Case 3 = str2
End Select
str3 = Left((Int(Rnd(lstr) * (999 - 100 + 1) + 100)) * lstr, 3)
Text4.Text = str1 & str2 & str3
End Sub
Private Sub Command7_Click()
Dim str1
Dim str2
Dim str3
str1 = Left(Text4.Text, 3)
str1 = Left(Hex(Val(str1)) & str1, 3)
str2 = Mid(Text4.Text, 4, 3)
str2 = Left(CStr(Val("&H" & str2)), 3)
str3 = Right(Text4.Text, 3)
str3 = Val(str3) + Val(Oct(str3))
str3 = Left(str3, 3)
Text5.Text = str1 & str2 & str3
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -