📄 frmqurey.frm
字号:
VERSION 5.00
Object = "{65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCHRT20.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmQurey
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "湖南省水电勘测设计院规划处水文室......潇湘莫大"
ClientHeight = 8025
ClientLeft = 60
ClientTop = 345
ClientWidth = 10875
LinkTopic = "Form1"
ScaleHeight = 11010
ScaleWidth = 15240
StartUpPosition = 3 'Windows Default
WindowState = 2 'Maximized
Begin VB.Timer Timer1
Interval = 1000
Left = 7080
Top = 5280
End
Begin VB.CommandButton cmdSave
Caption = "保存图片"
Height = 375
Left = 13680
TabIndex = 4
Top = 10440
Width = 1095
End
Begin MSChart20Lib.MSChart Chart
Height = 10095
Left = 3840
OleObjectBlob = "frmQurey.frx":0000
TabIndex = 2
Top = 240
Width = 10935
End
Begin MSAdodcLib.Adodc ADO1
Height = 375
Left = 120
Top = 9960
Width = 3495
_ExtentX = 6165
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\资料\VB源代码\VB处理断面水文数据\transect.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\资料\VB源代码\VB处理断面水文数据\transect.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "断面信息查询"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataGridLib.DataGrid Grid
CausesValidation= 0 'False
Height = 9135
Left = 120
TabIndex = 3
Top = 720
Width = 3450
_ExtentX = 6085
_ExtentY = 16113
_Version = 393216
BackColor = 16761024
DefColWidth = 107
ColumnHeaders = -1 'True
ForeColor = 16384
HeadLines = 2
RowHeight = 15
RowDividerStyle = 4
AllowAddNew = -1 'True
AllowDelete = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.TextBox txtQuery
Height = 375
Left = 1920
TabIndex = 1
Text = "1"
Top = 240
Width = 1635
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "查询断面号:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Left = 360
TabIndex = 0
Top = 315
Width = 1350
End
Begin VB.Menu m
Caption = "m"
Visible = 0 'False
Begin VB.Menu m1
Caption = "保存图形"
End
End
End
Attribute VB_Name = "frmQurey"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Dim str As String, pstr As String, strSQL As String
str = "Data Source=" & App.Path & "\transect.mdb;"
pstr = "Provider=Microsoft.Jet.OLEDB.4.0;" & str & "Persist Security Info=False"
strSQL = "select distance as 起点距, elevation as 高程 from 断面信息表 where ID = " & Trim(txtQuery.Text)
ADO1.ConnectionString = pstr
ADO1.CommandType = adCmdText
ADO1.RecordSource = strSQL
ADO1.Refresh
Set Grid.DataSource = ADO1 '用程序来实现绑定
Set Chart.DataSource = ADO1
txtQuery.SelStart = 0
txtQuery.SelLength = Len(txtQuery.Text)
End Sub
Private Sub m1_Click()
Dim xPic As Picture
If (txtQuery.Text <> "") Then
Chart.EditCopy
Set xPic = Clipboard.GetData()
SavePicture xPic, App.Path & "\Image" + txtQuery.Text + ".bmp "
End If
End Sub
Private Sub Timer1_Timer()
txtQuery.Text = Val(txtQuery.Text) + 1
txtQuery_KeyPress (13)
End Sub
Private Sub txtQuery_KeyPress(KeyAscii As Integer)
Dim strSQL As String
Dim i As Integer
Dim k As Integer
If (KeyAscii = 13) Then
strSQL = "select distance as 起点距, elevation as 高程 from 断面信息表 where ID = " + txtQuery.Text
ADO1.RecordSource = strSQL
ADO1.Refresh
txtQuery.SetFocus
txtQuery.SelStart = 0
txtQuery.SelLength = Len(txtQuery.Text)
End If
End Sub
Private Sub Chart_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then PopupMenu m
End Sub
Private Sub cmdSave_Click()
Call m1_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -