Solved

VB CONTROLS COLOR - PROBLEM WHEN MIGRATING OS TO WIN XP

Posted on 2004-08-26
9
183 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 3

Assisted Solution

by:nichia
nichia earned 250 total points
Comment Utility
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
Comment Utility
Of course you may also consider recompiling your project on an XP machine.
0
 
LVL 3

Expert Comment

by:nichia
Comment Utility
Feedback please....
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

744 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

17 Experts available now in Live!

Get 1:1 Help Now