📄 ganjianf.frm
字号:
VERSION 5.00
Begin VB.Form GanJianF
Caption = "请输入杆件单元信息"
ClientHeight = 4020
ClientLeft = 60
ClientTop = 450
ClientWidth = 4485
LinkTopic = "Form3"
ScaleHeight = 4020
ScaleWidth = 4485
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton WanCheng
Caption = "退出"
Height = 375
Left = 3000
TabIndex = 16
Top = 3360
Width = 1095
End
Begin VB.CommandButton QueDing
Caption = "确定"
Height = 375
Left = 240
TabIndex = 15
Top = 3360
Width = 1095
End
Begin VB.CommandButton Delete
Caption = "删除"
Height = 375
Left = 1680
TabIndex = 14
Top = 3360
Width = 1095
End
Begin VB.CommandButton Add
Caption = "最后一个"
Height = 375
Index = 4
Left = 3000
TabIndex = 13
Top = 2160
Width = 855
End
Begin VB.CommandButton Add
Caption = "第一个"
Height = 375
Index = 3
Left = 3000
TabIndex = 12
Top = 1680
Width = 855
End
Begin VB.CommandButton Add
Caption = "下翻"
Height = 375
Index = 2
Left = 3000
TabIndex = 11
Top = 1200
Width = 855
End
Begin VB.CommandButton Add
Caption = "上翻"
Height = 375
Index = 1
Left = 3000
TabIndex = 10
Top = 720
Width = 855
End
Begin VB.CommandButton Add
Caption = "新增"
Height = 375
Index = 0
Left = 3000
TabIndex = 9
Top = 240
Width = 855
End
Begin VB.TextBox Text3
Height = 375
Left = 1320
TabIndex = 3
Top = 2040
Width = 1095
End
Begin VB.TextBox Text2
Height = 375
Left = 1320
TabIndex = 2
Top = 1320
Width = 1095
End
Begin VB.TextBox Text1
Height = 375
Left = 1320
TabIndex = 1
Top = 600
Width = 1095
End
Begin VB.Label Label6
Alignment = 2 'Center
Caption = "编号"
Height = 255
Left = 360
TabIndex = 8
Top = 2760
Width = 855
End
Begin VB.Label Label5
Caption = "0/0"
Height = 375
Left = 1440
TabIndex = 7
Top = 2760
Width = 855
End
Begin VB.Label Label4
Alignment = 2 'Center
Caption = "横截面积"
Height = 255
Left = 240
TabIndex = 6
Top = 2160
Width = 975
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "始点"
Height = 255
Left = 480
TabIndex = 5
Top = 600
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "终点"
Height = 255
Left = 480
TabIndex = 4
Top = 1440
Width = 615
End
Begin VB.Label Label1
Caption = "杆间单元:"
Height = 255
Left = 240
TabIndex = 0
Top = 120
Width = 1095
End
End
Attribute VB_Name = "GanJianF"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim s As Integer
Private Sub Add_Click(Index As Integer) '生成杆件单元数据
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
QueDing.Enabled = True
If Index = 0 Then '新增
Add(0).Enabled = False
NNE = 2
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
NE1 = NE1 + 1
ReDim Preserve PROP1(NE1) As Double
ReDim Preserve NCO1(NNE * NE1)
s = NE1
Label5.Caption = s & "/" & NE1
ElseIf Index = 1 Then '前一个
If s = 0 Then
MsgBox ("error!")
ElseIf s = 1 Then
MsgBox ("已为第1个点!")
Else
s = s - 1
Text1.Text = NCO1(NNE * s - 1)
Text2.Text = NCO1(NNE * s)
Text3.Text = PROP1(s)
Label5.Caption = s & "/" & NE1
End If
ElseIf Index = 2 Then '后一个
If s = 0 Then
MsgBox ("error!")
ElseIf s = NE1 Then
MsgBox ("已为最后1个点!")
Else
s = s + 1
Text1.Text = NCO1(NNE * s - 1)
Text2.Text = NCO1(NNE * s)
Text3.Text = PROP1(s)
Label5.Caption = s & "/" & NE1
End If
ElseIf Index = 3 Then '第一个
If s = 0 Then
MsgBox ("error!")
Else
s = 1
Text1.Text = NCO1(1)
Text2.Text = NCO1(2)
Text3.Text = PROP1(1)
Label5.Caption = 1 & "/" & NE1
End If
ElseIf Index = 4 Then '最后一个
If s = 0 Then
MsgBox ("error!")
Else
s = NE1
Text1.Text = NCO1(NNE * s - 1)
Text2.Text = NCO1(NNE * s)
Text3.Text = PROP1(s)
Label5.Caption = s & "/" & NE1
End If
End If
HaveReaded = False
End Sub
Private Sub Delete_Click() '删除当前点的元素
If s = 0 Then
MsgBox ("操作错误!")
Exit Sub
End If
If NE1 = 1 Then
NCO1(s) = 0
NCO1(s + 1) = 0
PROP1(s) = 0
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label5.Caption = 0 & "/" & 0
s = 0
NE1 = NE1 - 1
Else
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
For h = s + 1 To NE1
NCO1(NNE * (h - 1) - 1) = NCO1(NNE * h - 1)
NCO1(NNE * (h - 1)) = NCO1(2 * h)
PROP1(h - 1) = PROP1(h)
Next
NE1 = NE1 - 1
If s > 1 Then s = s - 1
Text1.Text = NCO1(NNE * s - 1)
Text2.Text = NCO1(2 * s)
Text3.Text = PROP1(s)
Label5.Caption = s & "/" & NE1
End If
If s = 0 Then IsAddedGanJian = False
ReDim Preserve PROP1(NE1) As Double
ReDim Preserve NCO1(NNE * NE1)
HaveReaded = False
If HaveShowGraph = False Then Exit Sub
DrawPicture MainForm.MainPic, vbRed
If EditType <> -1 Then Unload Me
End Sub
Private Sub Form_Load()
If HaveReaded = False Then HaveShowGraph = True
If NE1 = 0 Then IsAddedGanJian = False
If IsAddedGanJian = False Then
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Add(1).Enabled = False
Add(2).Enabled = False
Add(3).Enabled = False
Add(4).Enabled = False
QueDing.Enabled = False
Delete.Enabled = False
WanCheng.Enabled = False
ReDim PROP1(100) As Double
ReDim NCO1(200)
Label5.Caption = 0 & "/" & 0
HaveShowGraph = True
ElseIf IsAddedGanJian = True Then
If isCatch = True And temps <= NE1 Then s = tempG
If s = 0 Then s = NE1
Text1.Text = NCO1(NNE * s - 1)
Text2.Text = NCO1(NNE * s)
Text3.Text = PROP1(s)
Label5.Caption = s & "/" & NE1
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
If NE1 = 0 Then
IsAddedGanJian = False
HaveShowGraph = False
End If
End Sub
Private Sub QueDing_Click() '生成杆件单元数
If s = 0 Then
MsgBox ("操作错误!")
Else
Add(0).Enabled = True
Add(1).Enabled = True
Add(2).Enabled = True
Add(3).Enabled = True
Add(4).Enabled = True
Delete.Enabled = True
WanCheng.Enabled = True
QueDing.Enabled = False
NCO1(NNE * (s - 1) + 1) = Val(Text1.Text)
NCO1(NNE * (s - 1) + 2) = Val(Text2.Text)
PROP1(s) = Val(Text3.Text)
IsAddedGanJian = True
ReDim Preserve PROP1(NE1) As Double
ReDim Preserve NCO1(NNE * NE1)
HaveReaded = False
If HaveShowGraph = False Then Exit Sub
DrawPicture MainForm.MainPic, vbRed
End If
End Sub
Private Sub WanCheng_Click()
Unload GanJianF
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -