You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rodrigo Ruz edited this page May 14, 2017
·
7 revisions
The Vcl.Styles.NC unit allows add controls in the Non Client Area of the forms through the TNCControls component, you can try a sample application here.
sample code
The next code shows how add a button to the title bar of the form.
procedureTForm1.FormCreate(Sender: TObject);
begin
NCControls := TNCControls.Create(Self);
//Set the image list
NCControls.Images := ImageList1;
//Add a NC Button
NCControls.Controls.AddEx<TNCButton>;
//Set the style of the button
NCControls[0].GetAs<TNCButton>.Style := nsSplitButton;
//Set the style of the image
NCControls[0].GetAs<TNCButton>.ImageStyle := isGrayHot;
NCControls[0].GetAs<TNCButton>.ImageIndex := 3;
//Set the bounds
NCControls[0].BoundsRect := Rect(30,5,100,25);
NCControls[0].Caption := 'Menu';
//Assign the menu and events.
NCControls[0].GetAs<TNCButton>.DropDownMenu:= PopupMenu1;
NCControls[0].GetAs<TNCButton>.OnClick := ButtonNCClick;
end;