Page 1 of 1

Group Box Frame Color ( again ) .. Nags?

Posted: Fri Apr 10, 2020 6:02 pm
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

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

Posted: Fri Apr 10, 2020 11:47 pm
by Silvio.Falconi
color codeblocks

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

Posted: Sat Apr 11, 2020 1:00 pm
by karinha

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

Posted: Sat Apr 11, 2020 3:18 pm
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

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

Posted: Sun Apr 12, 2020 1:38 pm
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.

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

Posted: Sun Apr 12, 2020 3:39 pm
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

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

Posted: Sun Apr 12, 2020 4:08 pm
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
      >
 

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

Posted: Mon Apr 13, 2020 1:05 pm
by Rick Lipkin
Rao

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

Rick Lipkin