Your Products have been synced, click here to refresh
results = bitmapDlg.List1
Case 2 ' Click fileName = ShortFilepath & DlgText("List1") DlgSetPicture "Picture1", fileName results = fileName
'========================================================= ' Bitmap sample using the Dir Function '========================================================= Sub DrawBitmapSample Dim Filepath As String Dim ShortFilepath As String Dim results As String ShortFilepath = "C:\Windows\" Filepath = Shortfilepath + "*.bmp" Dim MyList() Begin Dialog BitmapDlg 60, 60, 290, 220, "Enable bitmap sample", .DlgFunc ListBox 10, 10, 80, 180, MyList(), .List1, 2 Picture 100, 10, 180, 180, "Forest.bmp", 0, .Picture1 CancelButton 42, 198, 40, 12 OKButton 90, 198, 40, 12 End Dialog Dim frame As BitmapDlg ' Show the bitmap dialog Dialog frame results = bitmapDlg.List1 MsgBox results MsgBox fileName End Sub Function DlgFunc( controlID As String, action As Integer, suppValue As Integer) 'DlgFunc = 1 ' Keep dialog active Select Case action Case 1 ' Initialize temp = Dir( "C:\Windows\*.bmp" ) count = 0 While temp <> "" count = count + 1 temp = Dir Wend Dim x() As String ReDim x(count) x(0) = Dir( "C:\Windows\*.bmp" ) For i = 1 To count x(i) = Dir Next i DlgListBoxArray "List1", x() 'results = fileName Case 2 ' Click fileName = ShortFilepath & DlgText("List1") DlgSetPicture "Picture1", fileName results = fileName End Select End Function
' Bitmap sample using the Dir Function '========================================================= Sub DrawBitmapSample [COLOR="Red"]Dim MyFilename as string[/COLOR] Dim Filepath As String Dim ShortFilepath As String Dim results As String ShortFilepath = "C:\Windows\" Filepath = Shortfilepath + "*.bmp" Dim MyList() Begin Dialog BitmapDlg 60, 60, 290, 220, "Enable bitmap sample", .DlgFunc ListBox 10, 10, 80, 180, MyList(), .List1, 2 Picture 100, 10, 180, 180, "Forest.bmp", 0, .Picture1 CancelButton 42, 198, 40, 12 OKButton 90, 198, 40, 12 End Dialog Dim frame As BitmapDlg ' Show the bitmap dialog Dialog frame results = bitmapDlg.List1 MsgBox results MsgBox fileName End Sub Function DlgFunc( controlID As String, action As Integer, suppValue As Integer) 'DlgFunc = 1 ' Keep dialog active Select Case action Case 1 ' Initialize temp = Dir( "C:\Windows\*.bmp" ) count = 0 While temp <> "" count = count + 1 temp = Dir Wend Dim x() As String ReDim x(count) x(0) = Dir( "C:\Windows\*.bmp" ) For i = 1 To count x(i) = Dir Next i DlgListBoxArray "List1", x() 'results = fileName Case 2 ' Click fileName = ShortFilepath & DlgText("List1") [COLOR="red"]MyFilename = filename[/COLOR] [COLOR="red"]MsgBox MyFilename ' for debugging[/COLOR] DlgSetPicture "Picture1", fileName results = fileName End Select End Function
DlgListBoxArray "List1", x() [COLOR="Red"]DlgSetPicture "Picture1", x(0)[/COLOR] 'results = fileName
End Select [COLOR="Red"]DlgSetPicture "Picture1", x(0)[/COLOR] End Function
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |