Solved

VB CONTROLS COLOR - PROBLEM WHEN MIGRATING OS TO WIN XP

Posted on 2004-08-26
9
190 Views
Last Modified: 2012-08-13
Dear Expert,

We are developing applications using Visual Basic 6 and recently our clients moved from WIN 2000 to Win XP and we are facing the problem that forms or different controls changed colours, cannot keep the windows defaults.

For example a form insead of grey appears as white, or some labels background become heavier grey than the form, in order to destoy the nice feel of or screens.

Do you have an idea how we can fixed that by doing something generic and not b changing each control color?

Also this is happening to us on design time on the machines that have win XP....

Please advice us how to solve this problem...

Thanks for your time and consideration

With regards
Tassos Agathangelou

COSINE CONSULTANTS LTD
0
Comment
Question by:Cosine_Consultants
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
9 Comments
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 11900283
In your control color property, try select color from palette or self-defined color, don't select System colors.
0
 

Author Comment

by:Cosine_Consultants
ID: 11900682
Dear Expert,

Basically the colour of controls in vb 6 when you migrate from WIN 2000 or NT to WIN XP are destroyed.  It shows you the form background as white and the controls coloured changed based on the windows defaults.  

The solution we are looking is something that can fix this problem by doing it once since our applications are huge and we cannot go through each screen and correct it manually.

Thanks for your time

Regards
Tassos Agathangelou
0
 
LVL 52

Accepted Solution

by:
Ryan Chong earned 250 total points
ID: 11900784
You can set the control's backcolor programmingly let's say in the Form_Load event.

Example:

Private Sub Form_Load()
    Me.Show
   
    Dim ctrl As Control
   
    For Each ctrl In Me.Controls
        Select Case LCase$(TypeName(ctrl))
        Case "textbox"
            ctrl.BackColor = vbRed
        Case "frame"
            ctrl.BackColor = vbBlue
       Case Else
            ctrl.BackColor = vbWhite    
        End Select
       
    Next
End Sub
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Assisted Solution

by:nichia
nichia earned 250 total points
ID: 11903433
Assuming that all of your controls and forms are using the same color and you are not mixing system colors with palette colors. Correct?

As a test, change the "Windows and buttons" style back to "Windows Classic style" on the XP machine.
Control Panel->Display->[Appearance]

If this corrects the problem, then the issue may be that VB does not support XP themes and visual styles as described below:

http://support.microsoft.com/?id=309366

Hope it helps!
0
 
LVL 3

Expert Comment

by:nichia
ID: 11903490
Of course you may also consider recompiling your project on an XP machine.
0
 
LVL 3

Expert Comment

by:nichia
ID: 12071717
Feedback please....
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question