Ver Mensaje Individual
  #5  
Antiguo 05-12-2017
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola.

Derivando de un TPanel te hice un ejemplo básico como para que puedas ir trabajando sobre él:
Código PHP:
...

class 
TPanelClear : public TPanel {
protected:
  
void __fastcall CreateParams( TCreateParams &Params ) {
     
TPanel::CreateParams( Params );
     
Params.ExStyle |= WS_EX_TRANSPARENT;
  }
  
void __fastcall Paint() {
    
HDC DC   = Canvas->Handle;
    
TRect R  = ClientRect;
    
Graphics::TBitmap *BM = new Graphics::TBitmap;
    try {
      
BM->Height = Height;
      
BM->Width  = Width;
      
Canvas->Handle = BM->Canvas->Handle;
      
TPanel::Paint();
      
Canvas->Handle = DC;
      
Canvas->Brush->Style =  bsClear;
      
Canvas->BrushCopy(R, BM, R, Color);
    }
    
__finally {
      
delete BM;
    }
  }
public:
   
__fastcall TPanelClear( TComponent *Owner ) : TPanel( Owner ) {
    
// ...
   
}
   
// ...
};


void __fastcall TForm1::btShowPanelClearClick(TObject *Sender)
{
  
TPanelClear *pc = new TPanelClear(this);
  
pc->Left    = 5;
  
pc->Top     = 5;
  
pc->Height  = 50;
  
pc->Width   = 200;
  
pc->Name    = "PanelClear1";
  
pc->Caption = pc->Name;
  
pc->Parent  = this;
} 
Muestra:


Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....

Última edición por ecfisa fecha: 05-12-2017 a las 21:03:10.
Responder Con Cita