📄 frmini.frm
字号:
VERSION 5.00
Object = "{3B008041-905A-11D1-B4AE-444553540000}#1.0#0"; "VSOCX6.OCX"
Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "Vsflex7.ocx"
Begin VB.Form frmIni
Caption = "Ini配置"
ClientHeight = 2595
ClientLeft = 60
ClientTop = 345
ClientWidth = 6120
Icon = "frmIni.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2595
ScaleWidth = 6120
StartUpPosition = 2 'CenterScreen
Begin vsOcx6LibCtl.vsElastic vsElastic1
Height = 2595
Left = 0
TabIndex = 0
TabStop = 0 'False
Top = 0
Width = 6120
_ExtentX = 10795
_ExtentY = 4577
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Enabled = -1 'True
Appearance = 0
MousePointer = 0
_ConvInfo = -1
Version = 600
BackColor = -2147483633
ForeColor = -2147483630
FloodColor = 192
ForeColorDisabled= -2147483631
Caption = ""
Align = 5
Appearance = 0
AutoSizeChildren= 8
BorderWidth = 0
ChildSpacing = 4
Splitter = 0 'False
FloodDirection = 0
FloodPercent = 0
CaptionPos = 1
WordWrap = -1 'True
MaxChildSize = 0
MinChildSize = 0
TagWidth = 0
TagPosition = 0
Style = 0
TagSplit = 0 'False
PicturePos = 4
CaptionStyle = 0
ResizeFonts = 0 'False
GridRows = 2
GridCols = 3
_GridInfo = $"frmIni.frx":030A
Begin VB.CommandButton cmdOk
Caption = "确定"
Height = 360
Left = 3180
TabIndex = 3
Top = 2235
Width = 1440
End
Begin VB.CommandButton cmdcancel
Caption = "取消"
Height = 360
Left = 4680
TabIndex = 2
Top = 2235
Width = 1440
End
Begin VSFlex7Ctl.VSFlexGrid grdIni
Height = 2175
Left = 0
TabIndex = 1
Top = 0
Width = 6120
_cx = 10795
_cy = 3836
_ConvInfo = -1
Appearance = 1
BorderStyle = 1
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MousePointer = 0
BackColor = -2147483643
ForeColor = -2147483640
BackColorFixed = -2147483633
ForeColorFixed = -2147483630
BackColorSel = -2147483635
ForeColorSel = -2147483634
BackColorBkg = -2147483636
BackColorAlternate= -2147483643
GridColor = -2147483633
GridColorFixed = -2147483632
TreeColor = -2147483632
FloodColor = 192
SheetBorder = -2147483642
FocusRect = 1
HighLight = 1
AllowSelection = -1 'True
AllowBigSelection= -1 'True
AllowUserResizing= 0
SelectionMode = 0
GridLines = 1
GridLinesFixed = 2
GridLineWidth = 1
Rows = 50
Cols = 10
FixedRows = 1
FixedCols = 1
RowHeightMin = 0
RowHeightMax = 0
ColWidthMin = 0
ColWidthMax = 0
ExtendLastCol = 0 'False
FormatString = ""
ScrollTrack = 0 'False
ScrollBars = 3
ScrollTips = 0 'False
MergeCells = 0
MergeCompare = 0
AutoResize = -1 'True
AutoSizeMode = 0
AutoSearch = 0
AutoSearchDelay = 2
MultiTotals = -1 'True
SubtotalPosition= 1
OutlineBar = 0
OutlineCol = 0
Ellipsis = 0
ExplorerBar = 0
PicturesOver = 0 'False
FillStyle = 0
RightToLeft = 0 'False
PictureType = 0
TabBehavior = 0
OwnerDraw = 0
Editable = 0
ShowComboButton = -1 'True
WordWrap = 0 'False
TextStyle = 0
TextStyleFixed = 0
OleDragMode = 0
OleDropMode = 0
DataMode = 0
VirtualData = -1 'True
DataMember = ""
ComboSearch = 3
AutoSizeMouse = -1 'True
FrozenRows = 0
FrozenCols = 0
AllowUserFreezing= 0
BackColorFrozen = 0
ForeColorFrozen = 0
WallPaperAlignment= 9
End
End
End
Attribute VB_Name = "frmIni"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_Result As Boolean
Private Sub InitVg()
With grdIni
.Cols = 3
.Rows = 10
.ColWidth(0) = 500
.ColWidth(1) = 1200
.ColWidth(2) = 3000
.ColAlignment(0) = flexAlignLeftCenter
.ColAlignment(2) = flexAlignLeftCenter
.Editable = flexEDKbdMouse
.TextMatrix(0, 0) = "序号"
.TextMatrix(0, 1) = "名称"
.TextMatrix(0, 2) = "值"
.TextMatrix(1, 1) = "服务器名称"
.TextMatrix(2, 1) = "数据库名称"
.TextMatrix(3, 1) = "数据库登录名"
.TextMatrix(4, 1) = "业数据库密码"
.TextMatrix(5, 1) = "网关IP"
.TextMatrix(6, 1) = "端口"
.TextMatrix(7, 1) = "登录名"
.TextMatrix(8, 1) = "密码"
.TextMatrix(9, 1) = "网关接入号"
AddSerial grdIni
End With
End Sub
Private Sub AddSerial(ByVal objFg As VSFlexGrid)
'***************************************************
'目 的: 给网格加上序号
'输 入: ServerName 控件名称
'输出/返回:
'作 者: 张龙
'完成日期: 2003/03/31
'修 正 人:
'修正日期:
'****************************************************
Dim lngRow As Long
With objFg
For lngRow = 1 To .Rows - 1
.TextMatrix(lngRow, 0) = lngRow
Next
End With
End Sub
Private Sub cmdCancel_Click()
m_Result = False
Unload Me
End Sub
Private Sub cmdOk_Click()
If CheckAll = False Then Exit Sub
If WriteConfigMsg = False Then
MsgBox "写INI文件错", vbOKOnly + vbInformation, "提示"
Exit Sub
Else
m_Result = True
If frmMain.Visible = True Then
MsgBox "保存完毕,请重新运行程序。", vbInformation + vbOKOnly, Me.Caption
End If
Unload Me
End If
End Sub
Private Sub Form_Load()
InitVg
LoadAll
End Sub
Private Sub LoadAll()
If Trim(g_Ini.DataBase.BusiServerName) <> "" Then
With grdIni
.TextMatrix(1, 2) = g_Ini.DataBase.BusiServerName
.TextMatrix(2, 2) = g_Ini.DataBase.BusiDatabaseName
.TextMatrix(3, 2) = g_Ini.DataBase.BusiLoginName
.TextMatrix(4, 2) = g_Ini.DataBase.BusiPassword
.TextMatrix(5, 2) = g_Ini.DataBase.ip
.TextMatrix(6, 2) = g_Ini.DataBase.port
.TextMatrix(7, 2) = g_Ini.DataBase.name
.TextMatrix(8, 2) = g_Ini.DataBase.password
.TextMatrix(9, 2) = g_Ini.DataBase.spnumber
End With
Else
With grdIni
.TextMatrix(1, 2) = "(LOCAL)"
.TextMatrix(2, 2) = "MObileCat"
.TextMatrix(3, 2) = "mmmis"
.TextMatrix(4, 2) = "mmmis"
.TextMatrix(5, 2) = "192.168.0.113"
.TextMatrix(6, 2) = "88888"
.TextMatrix(7, 2) = "hongjing"
.TextMatrix(8, 2) = "111111"
.TextMatrix(9, 2) = "1982"
End With
End If
End Sub
Public Property Get Result() As Variant
Result = m_Result
End Property
Private Function CheckAll() As Boolean
CheckAll = False
With grdIni
If Trim(.TextMatrix(1, 2)) = "" Then
MsgBox "服务器名称不能为空", vbOKOnly + vbInformation, "提示"
.Row = 1
Exit Function
End If
If Trim(.TextMatrix(2, 2)) = "" Then
MsgBox "数据库名称不能为空", vbOKOnly + vbInformation, "提示"
.Row = 2
Exit Function
End If
If Trim(.TextMatrix(3, 2)) = "" Then
MsgBox "数据库登录名不能为空", vbOKOnly + vbInformation, "提示"
.Row = 3
Exit Function
End If
If Trim(.TextMatrix(4, 2)) = "" Then
MsgBox "数据库密码不能为空", vbOKOnly + vbInformation, "提示"
.Row = 4
Exit Function
End If
If Trim(.TextMatrix(5, 2)) = "" Then
MsgBox "网关IP不能为空", vbOKOnly + vbInformation, "提示"
.Row = 5
Exit Function
End If
If Trim(.TextMatrix(6, 2)) = "" Then
MsgBox "端口不能为空", vbOKOnly + vbInformation, "提示"
.Row = 6
Exit Function
End If
If Trim(.TextMatrix(7, 2)) = "" Then
MsgBox "登录名不能为空", vbOKOnly + vbInformation, "提示"
.Row = 7
Exit Function
End If
If Trim(.TextMatrix(8, 2)) = "" Then
MsgBox "密码不能为空", vbOKOnly + vbInformation, "提示"
.Row = 8
Exit Function
End If
If Trim(.TextMatrix(9, 2)) = "" Then
MsgBox "接入号不能为空", vbOKOnly + vbInformation, "提示"
.Row = 9
Exit Function
End If
g_Ini.DataBase.BusiServerName = .TextMatrix(1, 2)
g_Ini.DataBase.BusiDatabaseName = .TextMatrix(2, 2)
g_Ini.DataBase.BusiLoginName = .TextMatrix(3, 2)
g_Ini.DataBase.BusiPassword = .TextMatrix(4, 2)
g_Ini.DataBase.ip = .TextMatrix(5, 2)
g_Ini.DataBase.port = .TextMatrix(6, 2)
g_Ini.DataBase.name = .TextMatrix(7, 2)
g_Ini.DataBase.password = .TextMatrix(8, 2)
g_Ini.DataBase.spnumber = .TextMatrix(9, 2)
End With
CheckAll = True
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -