Group Box Frame Color ( again ) .. Nags?

Post Reply
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Group Box Frame Color ( again ) .. Nags?

Post by Rick Lipkin »

To All

I can not find the correct example in the forum .. I believe Nags came up with this code to add color to the group frame ..

Code: Select all

     oGrps:bPainted := < |hDC|
     RoundBox( hDC, 20,30,445,300,10,10,CLR_BLACK, 1 )
     Return nil
     >

   oGrps:bPainted := < |hDC|
      RoundBox( hDC, 20,340,445,500,10,10,CLR_HRED, 1 )
      Return nil
      >
 
And this code works well if you only want to color the RoundBox for the first instance .. but I have 2 group boxes on the same form and it is the last box that is drawn .. I do kinda see that the roundBox is directly tied to the hDc instance ..

Is there a way to modify this code to handle two or more group boxes on the same form ?

Thanks
Rick Lipkin
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Group Box Frame Color ( again ) .. Nags?

Post by Silvio.Falconi »

color codeblocks
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Group Box Frame Color ( again ) .. Nags?

Post by karinha »

João Santos - São Paulo - Brasil
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Group Box Frame Color ( again ) .. Nags?

Post by Rick Lipkin »

Gentleman

Unfortunately this code does not work probably due to my use of the XP Manifest

Code: Select all


   REDEFINE GROUP oGrp2 ID 209 of oGrps ;
            COLOR RGB(32,32,32), CLR_HRED ;
            PIXEL FONT oFontB

 
Appreciate your help .. unfortunately this was not the answer :( .. any other solutions ?

Thanks
Rick Lipkin
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Group Box Frame Color ( again ) .. Nags?

Post by nageswaragunupudi »

Rick Lipkin wrote:Gentleman

Unfortunately this code does not work probably due to my use of the XP Manifest

Code: Select all


   REDEFINE GROUP oGrp2 ID 209 of oGrps ;
            COLOR RGB(32,32,32), CLR_HRED ;
            PIXEL FONT oFontB

 
Appreciate your help .. unfortunately this was not the answer :( .. any other solutions ?

Thanks
Rick Lipkin
Yes. With manifest it does not work.
You need to draw boxes manually.
Please recheck your code.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Group Box Frame Color ( again ) .. Nags?

Post by Rick Lipkin »

Rao

In my original post .. the first RoundBox() instance works .. but try to use RoundBox() a second time .. takes president over the first instance .. and the first instance is no longer drawn.

I know it has something to do with the Dialog handle .. any advice or expertise is welcome.

Thanks
Rick Lipkin
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Group Box Frame Color ( again ) .. Nags?

Post by nageswaragunupudi »

Please try

Code: Select all

    oDlg:bPainted := < |hDC|
      RoundBox( hDC, 20,30,445,300,10,10,CLR_BLACK, 1 )
      RoundBox( hDC, 20,340,445,500,10,10,CLR_HRED, 1 )
      Return nil
      >
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Group Box Frame Color ( again ) .. Nags?

Post by Rick Lipkin »

Rao

Thank you ... I appreciate your help.. your suggestion worked Great!!

Rick Lipkin
Post Reply