Home > Language Reference > Functions > Color handling
ScreenMode Property
Current graphic mode.
Syntax
Public Property Get ScreenMode() As ScreenMode
Public Property Set ScreenMode(ByRef objScreenMode As ScreenMode)
| Parameter | Description |
| objScreenMode | A ScreenMode object whose fields define a valid graphics mode. |
Remarks
This property allows you to determine or modify the current graphic mode of the handheld device. When reading, it returns a ScreenMode object in which the Color and BitDepth properties represent the current graphic mode. When writing, it waits for a ScreenMode object in which the fields have been initialized to represent a valid graphic mode.
Once you modify the graphics mode, the screen is not refreshed. In certain cases, it may be necessary to refresh the current page by calling the Repaint method of the active form.
The following example displays the characteristics of the current graphics mode:
Private Sub Button1_Click() Dim sc As ScreenMode Dim s As String Set sc = ScreenMode s = "Number of colors : " & CLng(2^sc.BitDepth) s = s & "\nScreen color : " & sc.Color MsgBox s End Sub
Most of the time, only certain forms of your application require a different graphic mode to the default; these are pages that display images, for example your company logo on the "about" page. For performance reasons, it is advised that you do not use higher resolution graphics mode than is necessary. It is possible to reactivate the default graphics mode of your handheld device using the property DefaultScreenMode.
The following example illustrates the method of selecting the highest resolution graphics mode when a page is opened and restoring the default when it is closed.
Private Sub Form_Load() Dim sc As New ScreenMode sc.FindFirstMode Set ScreenMode = sc End Sub Private Sub Form_Unload() Set ScreenMode = DefaultScreenMode End Sub
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |