' items は、VBScript 側から渡されたデータ(配列でも Dictionary でも String でもお好みで) ' Public Function ShowDialog(ByVal items As Variant) As Variant Dim dlg As frmHist Set dlg = New frmHist dlg.Constructor items Load dlg dlg.Show vbModal ShowDialog = dlg.SelectedIndices Set dlg = Nothing End Function
Private m_items As Variant Private m_selectedIndices() As Variant Friend Sub Constructor(ByVal items As Variant) m_items = items End Sub Private Sub Form_Load() m_selectedIndices = Array() cmdOK.Default = True Dim vnt As Variant For Each vnt In m_items List1.Items.Add vnt Next End Sub