Mega Code Archive

 
Categories / Delphi / Forms
 

Change the window style for a control

The CreateParams method is used to set up the window style and all the other arguments that are passed to CreateWindowEx to create the control's To change the window style use something like this which creates a window with or without a vertical scroll bar. procedure TMyControl.CreateParams(var Params: TCreateParams) ; begin inherited CreateParams (Params) ; if IWantAScrollBar then Params.Style := Params.Style or WS_VSCROLL else Params.Style := Params.Style and not WS_VSCROLL ; end;