DlgSetPicture Instruction
Syntax
DlgSetPicture DlgItem, FileName, Type
Group
Description
Instruction - Sets the file name for DlgItem.
This instruction/function must be called directly or indirectly from a dialogfunc
Parameters
| Parameters | Description |
|---|---|
| DlgItem | A numeric value then it is the dialog item number. The first item is 0, second is 1, and so on. If this is a string value, it is the dialog item field name. |
| FileName | Sets the file name of DlgItem to this string value. |
| Type | The type of bitmap used. See below. |
| Type | Effect |
|---|---|
| 0 | FileName is the name of the bitmap file. If the file does not exist, (missing picture) is displayed. |
| 3 | The clipboard bitmap is displayed. If the clipboard does not contain a bitmap, (missing picture) is displayed. |
| 16 | Same a 0, but instead of displaying (missing picture), a runtime error occurs. |
| 19 | Same a 3, but instead of displaying (missing picture), a runtime error occurs. |
Example
Sub Main Begin Dialog UserDialog 200,120,.DialogFunc Picture 10,10,180,75,"",0,.Picture OKButton 30,90,60,20 PushButton 110,90,60,20,"&View" End Dialog Dim dlg As UserDialog Debug.Print Dialog(dlg) End Sub Function DialogFunc(DlgItem$, Action%, SuppValue?) As Boolean Debug.Print "Action="; Action% Select Case Action% Case 1 ' Dialog box initialization Beep Case 2 ' Value changing or button pressed Select Case DlgItem$ Case "View" FileName = GetFilePath("Bitmap","BMP") DlgSetPicture "Picture",FileName,0 DialogFunc = True 'do not exit the dialog End Select End Select End Function