Home > Language Reference > Classes > ScreenMode

FindFirstMode Function

Finds the first supported graphics modes.

Syntax

Public Function FindFirstMode() As Boolean

Remarks

The FindFirstMode function together with the FindNextMode function lists all the graphics modes supported by the device.

It initializes the list by attributing to the BitDepth et Color properties the characteristics of the highest graphics mode then returning the value True. You can enumerate the next modes by repeatedly calling the FindNextMode function until it returns the value False.

The following example displays the available graphic modes in a message box:

Private Sub Button1_Click()
  Dim sc as New ScreenMode
  Dim b as Boolean

  b = sc.FindFirstMode
  While b
    MsgBox "BitDepth = " & sc.BitDepth & "\nColor = " & sc.Color
    b = sc.FindNextMode
  Wend
End Sub

Graphic modes are always listed in the same order, from the highest mode down to the lowest mode. This means it is easy to set the best graphics mode, as this example shows:

Private Sub Button1_Click()
  Dim sc as New ScreenMode

  sc.FindFirstMode
  Set ScreenMode = sc
End Sub

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0-
Windows CEWindows CE 3.0-