📄 netdata.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmDataStore
AutoRedraw = -1 'True
BorderStyle = 1 'Fixed Single
Caption = "数据库配置"
ClientHeight = 1425
ClientLeft = 45
ClientTop = 330
ClientWidth = 6360
Icon = "NetData.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1425
ScaleWidth = 6360
Begin MSComDlg.CommonDialog dlgCommonDialog
Left = 4560
Top = 1200
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.PictureBox cmdBrowse
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 240
Left = 4155
Picture = "NetData.frx":0442
ScaleHeight = 240
ScaleWidth = 240
TabIndex = 4
ToolTipText = "请选择网络路径"
Top = 450
Width = 240
End
Begin VB.TextBox NetDataPath
BackColor = &H00FFFFFF&
ForeColor = &H00C00000&
Height = 330
Left = 345
MaxLength = 250
TabIndex = 0
Top = 420
Width = 3705
End
Begin VB.CommandButton NetCancel
Cancel = -1 'True
Caption = "取消(&C)"
Height = 405
Left = 4800
TabIndex = 2
Top = 675
Width = 1320
End
Begin VB.CommandButton OK
Caption = "确定(&O)"
Default = -1 'True
Enabled = 0 'False
Height = 405
Left = 4800
TabIndex = 1
Top = 240
Width = 1320
End
Begin VB.Line lBottom
BorderColor = &H00808080&
Visible = 0 'False
X1 = 4125
X2 = 4425
Y1 = 735
Y2 = 735
End
Begin VB.Line lRight
BorderColor = &H00FFFFFF&
Visible = 0 'False
X1 = 4425
X2 = 4425
Y1 = 420
Y2 = 735
End
Begin VB.Line lTop
BorderColor = &H00FFFFFF&
Visible = 0 'False
X1 = 4110
X2 = 4425
Y1 = 420
Y2 = 420
End
Begin VB.Line lLeft
BorderColor = &H00808080&
Visible = 0 'False
X1 = 4110
X2 = 4110
Y1 = 420
Y2 = 750
End
Begin VB.Line Line1
BorderColor = &H00808080&
Index = 4
X1 = 0
X2 = 6345
Y1 = 0
Y2 = 0
End
Begin VB.Line Line1
BorderColor = &H00E0E0E0&
Index = 1
X1 = 30
X2 = 6330
Y1 = 15
Y2 = 15
End
Begin VB.Line Line1
BorderColor = &H00E0E0E0&
Index = 2
X1 = 15
X2 = 6330
Y1 = 1410
Y2 = 1410
End
Begin VB.Line Line1
BorderColor = &H00808080&
Index = 3
X1 = 30
X2 = 6330
Y1 = 1395
Y2 = 1395
End
Begin VB.Line Line2
BorderColor = &H00808080&
Index = 2
X1 = 0
X2 = 0
Y1 = 0
Y2 = 1410
End
Begin VB.Line Line3
BorderColor = &H00E0E0E0&
Index = 2
X1 = 15
X2 = 15
Y1 = 15
Y2 = 1410
End
Begin VB.Line Line2
BorderColor = &H00808080&
Index = 1
X1 = 6330
X2 = 6330
Y1 = 0
Y2 = 1410
End
Begin VB.Line Line3
BorderColor = &H00E0E0E0&
Index = 1
X1 = 6345
X2 = 6345
Y1 = 0
Y2 = 1410
End
Begin VB.Line Line4
X1 = 150
X2 = 4560
Y1 = 225
Y2 = 225
End
Begin VB.Line Line3
BorderColor = &H00FFFFFF&
Index = 0
X1 = 135
X2 = 4560
Y1 = 1155
Y2 = 1155
End
Begin VB.Line Line2
BorderColor = &H00FFFFFF&
Index = 0
X1 = 4560
X2 = 4560
Y1 = 225
Y2 = 1170
End
Begin VB.Line Line1
Index = 0
X1 = 135
X2 = 135
Y1 = 225
Y2 = 1140
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = " 请输入或选择数据库所在的路径!"
ForeColor = &H00000080&
Height = 180
Left = 900
TabIndex = 3
Top = 870
Width = 2790
End
End
Attribute VB_Name = "frmDataStore"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const m_wCurOptIdx = 0
Dim lShow As Boolean
Private Sub cmdBrowse_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lTop.BorderColor = &H808080
lBottom.BorderColor = &HFFFFFF
Dim sFile As String
With dlgCommonDialog
.DialogTitle = "打开"
.CancelError = False
'ToDo: 设置 common dialog 控件的标志和属性
.Filter = "所有文件 (*.*)|*.*"
.ShowOpen
If Len(.FileName) = 0 Then
Exit Sub
End If
sFile = .FileName
NetDataPath = .FileName
End With
End Sub
Private Sub cmdBrowse_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If lShow = True Then Exit Sub '已经隐藏时退出
lLeft.Visible = True
lRight.Visible = True
lTop.Visible = True
lBottom.Visible = True
lShow = True
End Sub
Private Sub cmdBrowse_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
lTop.BorderColor = &HFFFFFF
lBottom.BorderColor = &H808080
End Sub
Private Sub Form_Load()
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2, Me.Width, Me.Height
AniShowFrm Me.hwnd
NetDataPath = App.Path & "\data.mdb"
Dim wIdx As Integer, nFolder As Long
Dim sPath As String * 256
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If lShow = False Then Exit Sub '已经隐藏时退出
lLeft.Visible = False
lRight.Visible = False
lTop.Visible = False
lBottom.Visible = False
lShow = False
End Sub
Private Sub NetCancel_Click()
Unload Me
End Sub
Private Sub NetDataPath_Change()
If Trim(NetDataPath.Text) = "" Then
OK.Enabled = False
Else
OK.Enabled = True
End If
End Sub
Private Sub NetDataPath_GotFocus()
NetDataPath.SelStart = 0
NetDataPath.SelLength = Len(Trim(NetDataPath.Text))
End Sub
Private Sub NetDataPath_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
SendKeys "{tab}"
End If
End Sub
Private Sub NetDataPath_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If lShow = False Then Exit Sub '已经隐藏时退出
lLeft.Visible = False
lRight.Visible = False
lTop.Visible = False
lBottom.Visible = False
lShow = False
End Sub
Private Sub OK_Click()
Unload Me
End Sub
Private Function GetFolderValue(wIdx As Integer) As Long
If wIdx < 2 Then
GetFolderValue = 0
ElseIf wIdx < 12 Then
GetFolderValue = wIdx
Else
GetFolderValue = wIdx + 4
End If
End Function
Private Function GetReturnType() As Long
Dim dwRtn As Long
dwRtn = dwRtn
GetReturnType = dwRtn
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -