GetColorCount Example for Access 2.0

This example displays a message box showing the number of unique colors in the control's current bitmap.

' Declare local variables.
Dim szMessage As String ' Buffer for the MessageBox string
Dim NumberOfColors As Long ' Number of colors in the bitmap

' Get the number of colors in the bitmap.
NumberOfColors = Me![LEAD1].Object.GetColorCount

' Display the result in a message.
szMessage = "The bitmap has " + CStr(NumberOfColors) + " colors"
MsgBox szMessage, 0, "Notice"