Print Page | Close Window

Grid Line Color Change

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=7433
Printed Date: 12 November 2024 at 8:01pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Grid Line Color Change
Posted By: Krenshau
Subject: Grid Line Color Change
Date Posted: 22 June 2007 at 4:42pm

Hello,

I am trying to figure out how to change the grid line color. I see the ReportControl.PaintManager.GridLineColor = , but I am having trouble figuring out the uint. I checked the demo, but I didn't see it in there.

Am I going about this the right way? I am using VS2005 C#.

Thank you for your help.



-------------
Ben
QAS Information Systems



Replies:
Posted By: apuhjee
Date Posted: 22 June 2007 at 5:33pm
Mike sent me this VB.NET code a while back.  Not really the right language or direction you're trying to go... but it might give you a place to start :)
 
Cheers ~ jp
 

Public Shared Function ColorFromUInt32(ByVal u32Color As UInt32) As Color

    Dim iByte As Integer

    Dim newRGB As Byte

    Dim iR As Byte

    Dim iG As Byte

    Dim iB As Byte

    Dim iRGB As Integer

 

    iByte = 0

    newRGB = 0

 

    For iRGB = 0 To 16 Step 8

        For iByte = iRGB To iRGB + 7

            If (Convert.ToInt32(u32Color) And (2 ^ iByte)) = (2 ^ iByte) Then

                newRGB = newRGB Or (2 ^ (iByte - iRGB))

            End If

        Next

 

        If (iRGB = 0) Then

            iR = newRGB

        ElseIf (iRGB = 8) Then

            iG = newRGB

        ElseIf (iRGB = 16) Then

            iB = newRGB

        End If

 

       newRGB = 0

    Next

 

    Return Color.FromArgb(iR, iG, iB)

End Function

 



Posted By: Krenshau
Date Posted: 22 June 2007 at 7:33pm
Thank you for that information. I made this code:
 
RegReport.PaintManager.GridLineColor = Convert.ToUInt32("1524");
 
and it turned the lines red. I am not quite getting how to find the correct number for the color I want, which is blue.
 
If anyone can point me to any articles that would describe this, I would be grateful.


-------------
Ben
QAS Information Systems


Posted By: Krenshau
Date Posted: 26 June 2007 at 7:22pm
anyone? at least how to turn the line blue?
 
I tried this:

RegReport.PaintManager.GridLineColor = Convert.ToUInt32("6085FF", 16);

because I thought it would convert the hex color to uint, but it is just redish. If anyone could set me straight on this, I would be very grateful.
 
 
Thank you.


-------------
Ben
QAS Information Systems


Posted By: Oleg
Date Posted: 27 June 2007 at 12:53am

wndReportControl.PaintManager.GridLineColor = (uint)Color.FromArgb(0x60, 0x85, 0xFF).ToArgb();

or just
 
wndReportControl.PaintManager.GridLineColor = 0xFF8560;
 
 
you need switch R and B - its math.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Krenshau
Date Posted: 28 June 2007 at 11:50pm
Math, crap. That's not something I am great at. Thanks for the code. I understand it, now. Thank you.

-------------
Ben
QAS Information Systems



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net