📄 form1.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Form1
Caption = "格网插值"
ClientHeight = 6015
ClientLeft = 60
ClientTop = 450
ClientWidth = 7320
LinkTopic = "Form1"
ScaleHeight = 6015
ScaleWidth = 7320
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command4
Caption = "退出"
Height = 735
Left = 4080
TabIndex = 30
Top = 5040
Width = 1695
End
Begin MSComDlg.CommonDialog CommonDialog2
Left = 3360
Top = 4080
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton Command3
Caption = "数据输出"
Height = 615
Left = 360
TabIndex = 29
Top = 4680
Width = 1095
End
Begin VB.TextBox Text13
Height = 495
Left = 1800
TabIndex = 27
Text = "Text13"
Top = 2760
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "计算"
Height = 495
Left = 360
TabIndex = 24
Top = 3600
Width = 1215
End
Begin VB.TextBox Text12
Height = 495
Left = 1800
TabIndex = 23
Text = "Text12"
Top = 3960
Width = 1215
End
Begin VB.TextBox Text11
Height = 495
Left = 4440
TabIndex = 22
Text = "Text11"
Top = 4080
Width = 960
End
Begin MSComCtl2.UpDown UpDown1
Height = 495
Left = 5520
TabIndex = 21
Top = 4080
Width = 255
_ExtentX = 450
_ExtentY = 873
_Version = 393216
Value = 20
BuddyControl = "Text11"
BuddyDispid = 196614
OrigLeft = 3480
OrigTop = 4200
OrigRight = 3735
OrigBottom = 4695
Increment = 20
Max = 200
SyncBuddy = -1 'True
BuddyProperty = 0
Enabled = -1 'True
End
Begin VB.TextBox Text10
Height = 375
Left = 4440
TabIndex = 18
Text = "Text10"
Top = 3240
Width = 1215
End
Begin VB.TextBox Text9
Height = 375
Left = 4440
TabIndex = 17
Text = "Text9"
Top = 2640
Width = 1215
End
Begin VB.TextBox Text8
Height = 375
Left = 4680
TabIndex = 14
Text = "Text8"
Top = 1200
Width = 975
End
Begin VB.TextBox Text7
Height = 375
Left = 1800
TabIndex = 13
Text = "Text7"
Top = 1200
Width = 975
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 6120
Top = 480
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton Command1
Caption = "输入数据"
Height = 615
Left = 360
TabIndex = 6
Top = 2640
Width = 1215
End
Begin VB.TextBox Text6
Height = 375
Left = 5640
TabIndex = 5
Text = "Text6"
Top = 1920
Width = 975
End
Begin VB.TextBox Text5
Height = 375
Left = 1920
TabIndex = 4
Text = "Text5"
Top = 1920
Width = 1335
End
Begin VB.TextBox Text4
Height = 375
Left = 4680
TabIndex = 3
Text = "Text4"
Top = 720
Width = 975
End
Begin VB.TextBox Text3
Height = 375
Left = 1800
TabIndex = 2
Text = "Text3"
Top = 720
Width = 975
End
Begin VB.TextBox Text2
Height = 375
Left = 4680
TabIndex = 1
Text = "Text2"
Top = 240
Width = 975
End
Begin VB.TextBox Text1
Height = 375
Left = 1800
TabIndex = 0
Text = "Text1"
Top = 240
Width = 975
End
Begin VB.Label Label13
Caption = "数据点总数"
Height = 255
Left = 1920
TabIndex = 28
Top = 2520
Width = 1095
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "初始矩形面积"
Height = 195
Left = 1800
TabIndex = 26
Top = 3600
Width = 1080
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "矩形面积增量"
Height = 195
Left = 4320
TabIndex = 25
Top = 3720
Width = 1080
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "插值点坐标"
Height = 195
Left = 3120
TabIndex = 20
Top = 3360
Width = 900
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "插值点坐标"
Height = 195
Left = 3240
TabIndex = 19
Top = 2760
Width = 900
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "西南角坐标X"
Height = 195
Left = 3360
TabIndex = 16
Top = 1320
Width = 1005
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "西南角坐标X"
Height = 195
Left = 360
TabIndex = 15
Top = 1320
Width = 1005
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "Y轴向格网格网间隔数"
Height = 195
Left = 3720
TabIndex = 12
Top = 2040
Width = 1725
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "X轴向格网间隔数"
Height = 195
Left = 360
TabIndex = 11
Top = 2040
Width = 1365
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "数据Ymax"
Height = 195
Left = 3480
TabIndex = 10
Top = 720
Width = 750
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "数据Ymin"
Height = 195
Left = 480
TabIndex = 9
Top = 840
Width = 705
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "数据Xmax"
Height = 195
Left = 3480
TabIndex = 8
Top = 240
Width = 750
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "数据Xmin"
Height = 195
Left = 480
TabIndex = 7
Top = 240
Width = 705
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DX As Double
Dim Dy As Double
Dim low As Integer
Dim row As Integer
Dim NO() As Integer
Dim M As Integer
Dim Xp As Double '插值点的Xp坐标
Dim Yp As Double '插值点的Yp坐标
Dim area As Double
Dim k As Integer
Dim L As Integer
Dim R As Integer
Dim D As Integer
Private Sub Command1_Click()
Dim str As String
Dim a() As String
Dim ss As String
On Error Resume Next
With Form1.CommonDialog1
.DialogTitle = "打开坐标文件"
.Filter = "文本文件(*.txt;*dat)|*.txt;*.dat"
.InitDir = "e:\"
.ShowOpen
End With
Open Form1.CommonDialog1.FileName For Input As #1
str = ""
Do While Not EOF(1)
Line Input #1, temp
str = str + temp + ", " ' vbCrLf
Loop
Close #1
ss = Replace(str, ",,", ",")
a = Split(ss, ",")
'ds = Join(a, " ") 空格代替a中的 ( ,)
' For i = 0 To UBound(a)
' Form1.TextBox1.Text = UserForm1.TextBox1.Text + a(i)
' Next i
k = UBound(a) \ 4
Form1.Text13.Text = k
ReDim NO(1 To k) As Integer
ReDim X(1 To k) As Double
ReDim Y(1 To k) As Double
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -