Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB CONTROLS COLOR - PROBLEM WHEN MIGRATING OS TO WIN XP

Posted on 2004-08-26
9
Medium Priority
?
193 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
6 Comments
 
LVL 54

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 54

Accepted Solution

by:
Ryan Chong earned 1000 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
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!

 
LVL 3

Assisted Solution

by:nichia
nichia earned 1000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 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…
Suggested Courses
Course of the Month21 days, 5 hours left to enroll

810 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