WinStudio
IWSFormComponent interface, objects that can contain images
Sets or returns the file name of a graphic file contained within a component.
object.BitmapFileName
Part |
Description |
object | Required. A reference to a form component object. |
object.BitmapFileName = string
Part |
Description |
object | Required. A reference to a form component object. |
string | Required. The file name of the graphic file. |
In the Get syntax, the return value is a string containing the file name of the graphic file.
In the Set syntax, to clear an image from a component, enter an empty string (" ") for the file name.
The following example assigns a warning graphic to a button component and then displays the message: "The background image being used is warning.png."
To clear the image, enter an empty string (" ") in place of "warning.png" on the fourth line. After clearing the image, the system then displays the message: "There is no background image assigned."
Sub Main() Dim oComponent As IWSFormComponent ThisForm.Components("ScriptButton").BitmapFileName = "warning.png" oComponent = ThisForm.Components("ScriptButton") If oComponent.BitmapFileName = "" Then Application.ShowMessage("There is no background image assigned.") Else Application.ShowMessage("The background image being used is " _ & oComponent.BitmapFileName & ".") End If End Sub