Creating a transparent Form 

In order to make a Form transparent, you have to override the CreateParams method and set the flag for transparency in the extended styles member.  This method is extremely useful for static forms, drawing operations, and is the basis of performing rubber-banding on the desktop.  It is less useful for forms that can be moved, since the transparency will be lost after a move operation. 

KEYWORDS: WS_EX_TRANSPARENT, CreateParams 
  


 

//in header file 
virtual void __fastcall TForm1::CreateParams(TCreateParams &Params);

 


 
 

//---------------------------------------------------------------------------
void __fastcall TForm1::CreateParams(TCreateParams &Params) 

    TForm::CreateParams(Params); 
    Params.ExStyle = Params.ExStyle | WS_EX_TRANSPARENT;