Solved

VB CONTROLS COLOR - PROBLEM WHEN MIGRATING OS TO WIN XP

Posted on 2004-08-26
9
184 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 49

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 49

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now