📄 frmmanageplat.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmmanagePlat
Caption = "站点管理"
ClientHeight = 4635
ClientLeft = 60
ClientTop = 345
ClientWidth = 7080
LinkTopic = "FrmMain"
ScaleHeight = 4635
ScaleWidth = 7080
StartUpPosition = 3 '窗口缺省
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 2775
Left = 720
TabIndex = 4
Top = 1680
Width = 5895
_ExtentX = 10398
_ExtentY = 4895
_Version = 393216
Rows = 8
Cols = 22
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 375
Left = 3960
TabIndex = 2
Top = 600
Width = 975
End
Begin VB.CommandButton Demand_Command
Caption = "显示"
Height = 375
Left = 1920
TabIndex = 1
Top = 600
Width = 975
End
Begin VB.Frame Frame1
Height = 975
Left = 1200
TabIndex = 3
Top = 240
Width = 4455
End
Begin VB.TextBox TextName
Height = 375
Left = 2640
TabIndex = 0
Top = 240
Width = 180
End
End
Attribute VB_Name = "frmmanagePlat"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub ShowData(strQuery As String)
Dim rs As New ADODB.Recordset
Set rs = getRS(strQuery, "shujuku")
If rs.EOF = False Then
With Me.MSFlexGrid1
.Rows = 1
While Not rs.EOF
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = rs(0)
.TextMatrix(.Rows - 1, 1) = rs(1)
.TextMatrix(.Rows - 1, 2) = rs(2)
.TextMatrix(.Rows - 1, 3) = rs(3)
.TextMatrix(.Rows - 1, 4) = rs(4)
.TextMatrix(.Rows - 1, 5) = rs(5)
.TextMatrix(.Rows - 1, 6) = rs(6)
.TextMatrix(.Rows - 1, 7) = rs(7)
.TextMatrix(.Rows - 1, 8) = rs(8)
.TextMatrix(.Rows - 1, 9) = rs(9)
.TextMatrix(.Rows - 1, 10) = rs(10)
.TextMatrix(.Rows - 1, 11) = rs(11)
.TextMatrix(.Rows - 1, 12) = rs(12)
.TextMatrix(.Rows - 1, 13) = rs(13)
.TextMatrix(.Rows - 1, 14) = rs(14)
.TextMatrix(.Rows - 1, 15) = rs(15)
.TextMatrix(.Rows - 1, 16) = rs(16)
.TextMatrix(.Rows - 1, 17) = rs(17)
.TextMatrix(.Rows - 1, 18) = rs(18)
.TextMatrix(.Rows - 1, 19) = rs(19)
.TextMatrix(.Rows - 1, 20) = rs(20)
.TextMatrix(.Rows - 1, 21) = rs(21)
rs.MoveNext
Wend
End With
rs.Close
End If
End Sub
Public Sub showTopic()
Dim i As Integer
With Me.MSFlexGrid1 '设置表头
.TextMatrix(0, 0) = "站点编号"
.TextMatrix(0, 1) = "站点名称"
.TextMatrix(0, 2) = "使用线路1"
.TextMatrix(0, 3) = "使用线路2"
.TextMatrix(0, 4) = "使用线路3"
.TextMatrix(0, 5) = "使用线路4"
.TextMatrix(0, 6) = "使用线路5"
.TextMatrix(0, 7) = "使用线路6"
.TextMatrix(0, 8) = "使用线路7"
.TextMatrix(0, 9) = "使用线路8"
.TextMatrix(0, 10) = "使用线路9"
.TextMatrix(0, 11) = "使用线路10"
.TextMatrix(0, 12) = "使用线路11"
.TextMatrix(0, 13) = "使用线路12"
.TextMatrix(0, 14) = "使用线路13"
.TextMatrix(0, 15) = "使用线路14"
.TextMatrix(0, 16) = "使用线路15"
.TextMatrix(0, 17) = "使用线路16"
.TextMatrix(0, 18) = "使用线路17"
.TextMatrix(0, 19) = "使用线路18"
.TextMatrix(0, 20) = "使用线路19"
.TextMatrix(0, 21) = "使用线路20"
For i = 0 To 21 '设置所有表格对齐方式
.ColAlignment(i) = 4
Next i
For i = 0 To 21
.ColWidth(i) = 1500
Next i
For i = 0 To 21 '设置每列宽度
.ColWidth(i) = 1000
Next i
For i = 0 To 21
.ColWidth(i) = 1500
Next i
End With
End Sub
Private Sub cmdCancel_Click()
Unload Me
Exit Sub
End Sub
Private Sub Demand_Command_Click()
Dim sql As String
sql = " & TextName.Text & "
sql = "select * from PlatInfo where PlatName like '" & "%" & TextName.Text & "%'"
Call showTopic
Call ShowData(sql)
frmmanagePlat.Show
frmmanagePlat.ZOrder 0
End Sub
Private Sub Form_Load()
Dim sql As String
If ichangeFlag = 2 Then
sql = "select * from PlatInfo order by PlatNO"
Call showTopic
Call ShowData(sql)
End If
End Sub
Private Sub MSFlexGrid1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Shift = 0 And Button = 2 Then
PopupMenu frmPopmenu.popmenu2
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -