Estimados, como puedo asignar un color a un panel?
como este hereda de tcontrols intento usar oPanel:SetColor(CLR_BLACK, CLR_BLACK) y no me funciona, necesito que al inicio el tpanel se muetre en negro
Tpanel con color
- carlos vargas
- Posts: 1421
- Joined: Tue Oct 11, 2005 5:01 pm
- Location: Nicaragua
Tpanel con color
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
Carlos Vargas
Desde Managua, Nicaragua (CA)
Re: Tpanel con color
Un tip: Inténtalo con un brush.
Code: Select all
oPanel:SetBrush(oBrush)
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Tpanel con color
Carlos,
Prueba a modificar el método EraseBkGnd() de la Clase TPanel así:
Prueba a modificar el método EraseBkGnd() de la Clase TPanel así:
Code: Select all
METHOD EraseBkGnd( hDC ) CLASS TPanel
if ::oWnd != nil .and. IsAppThemed() .and. ;
Upper( ::oWnd:ClassName() ) $ "TFOLDER,TFOLDEREX,TREBAR,TGROUP,TPANEL"
DrawPBack( ::hWnd, hDC )
return 1
else
::PaintBack( hDC )
endif
return 1
Re: Tpanel con color
Este código funciona
Saludos
Code: Select all
#include "fivewin.ch"
Static oWnd
Static oPnl
//----------------------------------------------------------------------------//
Function Main()
Define Window oWnd //Pixel
@ 10, 10 Panel oPnl Size 500, 500 Of oWnd
oPnl : SetColor( 0, 0 )
oPnl : nOpacity := 255
Activate Window oWnd Maximized
Return 0
- carlos vargas
- Posts: 1421
- Joined: Tue Oct 11, 2005 5:01 pm
- Location: Nicaragua
Re: Tpanel con color
Funciona, gracias horacio.
Antonio, no hubo necesidad del cambio en la clase.
Antonio, no hubo necesidad del cambio en la clase.
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
Carlos Vargas
Desde Managua, Nicaragua (CA)
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: Tpanel con color
Carlos,
I have been using oPanel:setColor() for years without problem. Here is a working example.
James
I have been using oPanel:setColor() for years without problem. Here is a working example.
Code: Select all
#include "fivewin.ch"
#include "colors.ch"
Function Main()
Local oWnd
Define window oWnd
oPanel:= TPanel():new()
oPanel:setColor(CLR_BLACK, CLR_BLACK)
oWnd:oClient:= oPanel
Activate window ownd
Return nil
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10