Microsoft KB Archive/177081

= BUG: Control Displays Dithered Background in 256-Color Mode =

Article ID: 177081

Article Last Modified on 11/18/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition

-



This article was previously published under Q177081



SYMPTOMS
A form using a custom palette dithers the background color of any control placed on the form when the project is run on a computer configured to display 256 colors. This symptom does not occur on a computer configured to display more than 256 colors.



RESOLUTION
To work around this problem:


 * Run the Visual Basic program on a system configured to display more than 256 colors.

-or-
 * Do not use a custom palette.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
NOTE: To reproduce this problem, your system display should be set to 256-color.

 Start a new Standard EXE project in Visual Basic. Form1 is created by default. Add a Frame control to Form1.  Set the following properties for Form1:   Property                 Value -  Picture                  pastel.dib PaletteMode             1-UseZOrder

The file pastel.dib is located in the Samples\PGuide\PalMode directory where you installed Visual Basic.   Copy the following code to the Code window of Form1: Option Explicit

Private Sub Form_Load Me.BackColor = RGB(24, 180, 164) Frame1.BackColor = RGB(24, 180, 164) End Sub

 Press the F5 key to run the program and note that the Frame background appears dithered.</li></ol>

<div class="references_section">