I’m very pleased to introduce a very cool new feature to the VCL Styles Utils project. This is the support for controls in the Non Client Area of the forms through the TNCControls component.
Check the next form with the Auric Vcl Style applied.
Now the same form but with a set of NC Buttons in the title bar.
To use in your forms you only need to add the Vcl.Styles.NC and Vcl.Styles.FormStyleHooks units to your project and create a TNCControls component in each form where do you want use the NC Controls.
Check the next sample code
procedure TForm1.FormCreate(Sender: TObject); begin NCControls:=TNCControls.Create(Self); //Add a NC Button NCControls.List.Add(TNCButton.Create(NCControls)); //Set the style of the button NCControls.List.Style := nsSplitButton; //Set the style of the image NCControls.List.ImageStyle := isGrayHot; //Set the image list NCControls.List.Images := ImageList1; NCControls.List.ImageIndex := 3; //Set the bounds NCControls.List.BoundsRect := Rect(30,5,100,25); NCControls.List.Caption := 'Menu'; //Assign the menu and events. NCControls.List.DropDownMenu:= PopupMenu1; NCControls.List.OnClick := ButtonNCClick; end;
And this is the result
Exist 4 kind of buttons which you can choose.
Also you can use a custom Vcl Style to draw the controls.
Try the sample application from the project repository.
Also you can download a compiled demo from here.
Remember report any bug o made your suggestions via the issue page of the project.
August 24, 2014 at 3:56 pm
That’s really awesome! I had been looking into properly adding buttons etc to the titlebar for ages but all attempts were a messy outcome, this is great!
August 25, 2014 at 2:00 am
whow, really nice stuff
August 25, 2014 at 11:11 am
Can you make it work with the default Windows style?
August 25, 2014 at 11:44 am
This component is specific for the VCL Styles. For the Windows native look and feel is necessary write a new component, maybe I will do that in the future ;)