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
Solved

VB CONTROLS COLOR - PROBLEM WHEN MIGRATING OS TO WIN XP

Posted on 2004-08-26
9
186 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
  • 3
  • 2
9 Comments
 
LVL 50

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 50

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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

840 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