7,763
社区成员
发帖
与我相关
我的任务
分享
Private Sub getBomInfo()
Dim bomlist As FrmBomList
FrmBomList.Show
textbox1.text=bomstr
END SUB
Public bomstr As String
Private Sub Command2_Click()
bomstr = ""
If ListView1.ListItems.Count < 1 Then
Dim i As Integer
i = MsgBox("此Part无信息,请确认", 16, "提示") '消息框提示
Else
Dim PartInfo As String
PartInfo = ""
For i = 0 To ListView1.ListItems.Count - 1
'If ListView1.ListItems(I + 1).Checked = True Then
If ListView1.ListItems.Item(i + 1).Checked = True Then
PartInfo = PartInfo + CStr(ListView1.ListItems(i + 1).SubItems(1)) + "," 'i+1为定义的行数
End If
'I = I + 1
Next
If Len(PartInfo) >= 1 Then
Text1.Text = Mid(PartInfo, 1, Len(PartInfo) - 1)
bomstr = Text1.Text
End If
End If
End Sub
Private Sub Command1_Click()
Form2.Show 1
End Sub
Private Sub Command1_Click()
'strSelectedName = ""
If ListView1.ListItems.Count < 1 Then
Dim i As Integer
i = MsgBox("此Part无信息,请确认", 16, "提示") '消息框提示
Else
Dim PartInfo As String
PartInfo = ""
For i = 0 To ListView1.ListItems.Count - 1
'If ListView1.ListItems(I + 1).Checked = True Then
If ListView1.ListItems.Item(i + 1).Checked = True Then
'PartInfo = PartInfo + CStr(ListView1.ListItems(i + 1).SubItems(1)) + "," 'i+1为定义的行数
PartInfo = PartInfo + ListView1.ListItems(i + 1).Text + ","
End If
'I = I + 1
Next
If Len(PartInfo) >= 1 Then
'Text1.Text = Mid(PartInfo, 1, Len(PartInfo) - 1)
'bomstr = Text1.Text
Form1.Text1.Text = PartInfo
End If
End If
Unload Me
End Sub
Private Sub Form_Load()
For i = 1 To 10
Me.ListView1.ListItems.Add i, "A" + CStr(i), "Boss" + CStr(i)
Next i
End Sub
'Form1
Option Explicit
Public Property Let bomstr(ByVal RHS As String)
textbox1.Text = RHS
End Property
Private Sub getBomInfo()
FrmBomList.Action Me
End Sub
'FrmBomList
Option Explicit
Private m_OwnerForm As Form1
Public Sub Action(ByVal OwnerForm As Form1)
Set m_OwnerForm = OwnerForm
m_OwnerForm.bomstr = ""
Me.Show , OwnerForm
End Sub
Private Sub Command2_Click()
If ListView1.ListItems.Count < 1 Then
Dim i As Integer
i = MsgBox("此Part无信息,请确认", 16, "提示") '消息框提示'
Else
Dim PartInfo As String
PartInfo = ""
For i = 0 To ListView1.ListItems.Count - 1
'If ListView1.ListItems(I + 1).Checked = True Then
If ListView1.ListItems.Item(i + 1).Checked = True Then
PartInfo = PartInfo + CStr(ListView1.ListItems(i + 1).SubItems(1)) + "," 'i+1为定义的行数'
End If
'I = I + 1
Next
If Len(PartInfo) >= 1 Then
Text1.Text = Mid(PartInfo, 1, Len(PartInfo) - 1)
m_OwnerForm.bomstr = Text1.Text
End If
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set m_OwnerForm = Nothing
End Sub