📄 form5.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form5
BackColor = &H8000000D&
Caption = "装箱图"
ClientHeight = 7320
ClientLeft = 60
ClientTop = 450
ClientWidth = 11310
LinkTopic = "Form5"
ScaleHeight = 7320
ScaleWidth = 11310
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture2
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 5745
Left = 0
ScaleHeight = 5745
ScaleWidth = 3060
TabIndex = 1
Top = 1575
Width = 3060
Begin MSComctlLib.TreeView TreeView1
Height = 4005
Left = 0
TabIndex = 3
Top = 105
Width = 3060
_ExtentX = 5398
_ExtentY = 7064
_Version = 393217
LabelEdit = 1
Style = 7
SingleSel = -1 'True
BorderStyle = 1
Appearance = 0
End
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 5430
Left = 3045
ScaleHeight = 5400
ScaleWidth = 8235
TabIndex = 0
Top = 1680
Width = 8265
Begin VB.Label Label1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
ForeColor = &H80000008&
Height = 630
Left = 4305
TabIndex = 4
Top = 4725
Width = 585
End
End
Begin MSComctlLib.ListView ListView1
Height = 2325
Left = 0
TabIndex = 2
Top = 0
Width = 11355
_ExtentX = 20029
_ExtentY = 4101
View = 3
LabelWrap = -1 'True
HideSelection = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 0
NumItems = 4
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "方案"
Object.Width = 970
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "效率"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "容器"
Object.Width = 3528
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "策略"
Object.Width = 14111
EndProperty
End
Begin VB.Menu popmun
Caption = "popmun"
Visible = 0 'False
Begin VB.Menu popline4
Caption = "-"
End
Begin VB.Menu popclear
Caption = "擦除图形"
End
Begin VB.Menu popline1
Caption = "-"
End
Begin VB.Menu popsave
Caption = "保存图形"
End
Begin VB.Menu popline3
Caption = "-"
End
Begin VB.Menu popprint
Caption = "打印图形"
End
Begin VB.Menu popline2
Caption = "-"
End
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'作者:龙骑士(725989)
'发布日期:2007/03/07
'描 述:集装箱装箱计算源代码
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Private Sub Form_Load()
ListView1.Height = 2400
ListView1.Top = 0
ListView1.Left = 0
ListView1.Width = Me.ScaleWidth
Picture1.Left = 3060 + 50
Picture1.Top = ListView1.Height + 50
Picture1.Height = Me.ScaleHeight - 2400 - 50
Picture2.Left = 0
Picture2.Top = ListView1.Height + 50
Picture2.Height = Me.ScaleHeight - 2400 - 50
TreeView1.Height = Picture2.ScaleHeight
TreeView1.Top = 0
TreeView1.Left = 0
Picture2.Width = 3060
Picture1.Width = Me.ScaleWidth - 3060 - 50
Picture1.ScaleMode = 1
Label1.Width = Picture1.ScaleWidth - 400
Label1.Left = 200
Label1.Top = Picture1.ScaleHeight - 620
init_pic
End Sub
Private Sub init_treeview(ByVal se As String)
pro_name = ""
root_index = 0
con_num_i = 0
st_end = Split(se, "|")
TreeView1.Nodes.Clear
For I = CInt(st_end(0)) To CInt(st_end(1))
textline = ss(I)
If Mid(textline, 1, 7) = "PRO_NUM" Then
pic_label = Replace(textline, "|", " ")
ElseIf Mid(textline, 1, 7) = "PRO_EFF" Then
temps = Split(textline, "|")
pic_label = pic_label + " 方案效率:" + CStr(Format(temps(1), "0.00%"))
Else
temps = Split(textline, "|")
If con_num_i <> CInt(temps(0)) Then
pro_name = "PRO_" & temps(0)
con_num_i = CInt(temps(0))
Set nodX = TreeView1.Nodes.Add(, , pro_name, "容器:" & temps(0))
root_index = nodX.Index
End If
If CInt(temps(3)) > 0 Then
Texts1 = pro_name & "WC" & temps(2) & "_" & temps(3)
Texts2 = "工作面:" & temps(2) & " 子工作面:" & temps(3)
Else
Texts1 = pro_name & "W" & temps(2) & "_" & temps(3)
Texts2 = "工作面:" & temps(2) & " 子工作面:0"
End If
Set nodX = TreeView1.Nodes.Add(pro_name, tvwChild, Texts1, Texts2)
nodX.Tag = textline
End If
Next
For Each nods In TreeView1.Nodes
If nods.Children > 0 Then
nods.Tag = pic_label
End If
Next
nodX.EnsureVisible
End Sub
Private Sub init_pic()
Open App.Path + "\temps.txt" For Input As #2
Seek #2, 1
I = 0
Dim nodX As Node
'第N个容器|容器在LISTVIEW中索引|工作面编号|子工作面编号|货物再LISTVIEW中索引
'|货物名称|装载的货物数量|X方向可装载的数量|Y方向可装载的数量|Z方向可装载的数量
'|起点X坐标|起点Y坐标|起点Z坐标|是否水平旋转
Do While Not EOF(2) ' 循环至文件尾。
I = I + 1
ReDim Preserve ss(1 To I)
Line Input #2, textline ' 读入一行数据。
If Mid(textline, 1, 7) = "PRO_NUM" Then
temps = Split(textline, "|")
Set itmx = ListView1.ListItems.Add(, , temps(1))
itmx.Tag = CStr(I)
itmx.SubItems(2) = temps(2)
itmx.SubItems(3) = temps(3) + " " + temps(4) + " " + temps(5)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -