creating a panel with border

creating a panel with border

Postby Silvio.Falconi » Mon May 21, 2018 6:37 pm

I wish create a colored panel but I cannot show the border ...why ?
this is the sources :

oPanelCustomer:=Tpanel():New( 35, 5, 55, oFld:aDialogs[1]:nWidth-5, oFld:aDialogs[1])
oPanelCustomer:SetBrush( oBrushGreen )
oPanelCustomer:WinStyle(WS_BORDER, .t.)
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: creating a panel with border

Postby horacio » Mon May 21, 2018 8:49 pm

Test with bPainted

Code: Select all  Expand view

oPanel : bPainted := { | hDc | FunctionPaint( hDc ) }
 


Code: Select all  Expand view

Function FunctionPaint( hDc )

    Local hOldPen
    Local hPen := CreatePen( PS_SOLID, 1, Rgb( 125, 125, 125 ) )
   
    hOldPen := SelectObject( hDc, hPen )   
    Rectangle( hDc, 1, 1, oPanel : nHeight - 1 , oPanel : nWidth - 1 )
    SelectObject( hDc, hOldPen )
    DeleteObject( hPen )
    Return Nil
 


Saludos
horacio
 
Posts: 1363
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: creating a panel with border

Postby Silvio.Falconi » Tue May 22, 2018 3:53 pm

I see the border but the panel lose the brush color I insert it
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: creating a panel with border

Postby nageswaragunupudi » Wed May 23, 2018 2:58 pm

Code: Select all  Expand view
  oPanel:bPainted := { || oPanel:Box( 1,1,oPanel:nHeight-1,oPanel:nWidth-1 ) }
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: creating a panel with border

Postby Silvio.Falconi » Wed May 23, 2018 4:16 pm

thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 45 guests