Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Grid Line Color Change
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Grid Line Color Change

 Post Reply Post Reply
Author
Message
Krenshau View Drop Down
Groupie
Groupie
Avatar

Joined: 15 October 2005
Location: United States
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krenshau Quote  Post ReplyReply Direct Link To This Post Topic: Grid Line Color Change
    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
Back to Top
apuhjee View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 September 2005
Location: United States
Status: Offline
Points: 130
Post Options Post Options   Thanks (0) Thanks(0)   Quote apuhjee Quote  Post ReplyReply Direct Link To This Post 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

 

Back to Top
Krenshau View Drop Down
Groupie
Groupie
Avatar

Joined: 15 October 2005
Location: United States
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krenshau Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Krenshau View Drop Down
Groupie
Groupie
Avatar

Joined: 15 October 2005
Location: United States
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krenshau Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Krenshau View Drop Down
Groupie
Groupie
Avatar

Joined: 15 October 2005
Location: United States
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krenshau Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.