I just added a set of new features to the VCL Styles Utils project
New NC Buttons styles
Two new styles was added to the TNCButton control (nsAlpha and nsGradient). So now you can add Alpha-blended and Gradient buttons to the title bar of the Forms.
To add a button in the NC Area, only you need add a TNCControls component to your form and then insert a TNCButton in the collection like so.
NCControls:=TNCControls.Create(Self); NCControls.Add(TNCButton.Create(NCControls)); NCControls.Style := nsAlpha; NCControls.ImageStyle := isNormal; NCControls.Images := ImageList1; NCControls.ImageIndex := 0; NCControls.BoundsRect := Rect(30, 1, 120, 26); NCControls.Caption := 'nsAlpha1'; NCControls.Name := 'nsAlpha1'; NCControls.AlphaColor := clWebLavender; NCControls.AlphaHotColor:= clWebAliceBlue; NCControls.FontColor := clWhite; NCControls.HotFontColor:= clYellow; NCControls.OnClick := ButtonNCClick;
Support for Custom VCL Styles in the NonClient Area
The TNCControls component was updated to support a different custom VCL Style in the NC Area. Check these screenshots with the glow style (this is the application VCL Style) in the body of the form and a custom VCL Style in the NC Area.
To activate a custom style in the NC Area, only you need add a TNCControls component to your form and set the StyleServices property
NCControls:=TNCControls.Create(Self); NCControls.StyleServices := TStyleManager.Style['Sky']; //Set the Sky vcl style to be used to draw the NC Area of the form
You can check the sample application here.
May 21, 2015 at 6:40 am
That’s very cool , i really like the “New NC Buttons styles”.
About the custom VclStyles in the NonClient Area, isn’t going to slow the app ? and isn’t going to use a huge memory ?
You know that styles are not removed from memory after changing styles .. every time you set a style , a two styles will be used (one in the ClientArea , the other one in the NonClientArea). Keep changing the styles by the used will leads to memory performance issue.
May 22, 2015 at 10:22 am
Hi Mahdi, Only the first time which the VCL Style is loaded, the memory usage is increased. So Yes you need more memory to use 2 o more VCL Styles at the same time but that is how the VCL Styles works :(
February 24, 2016 at 7:55 am
really nice plugin
is it possible to color nsTab style. i can see that setting the alpha values only work on nsAlpha
February 24, 2016 at 12:32 pm
Hi, No you can’t change the color of a NC control when the nsTab style is used. For any further questions you can use the issue page of the project.
June 5, 2020 at 1:27 pm
Hi, features request
1- When button is not enabled, set the ThemeTextColor to clGrayText.
if AMouseInControl then
ThemeTextColor := FHotFontColor
ThemeTextColor := FFontColor;
if not Enabled then
ThemeTextColor := clGrayText;
to avoid painting other color on hovering.
2- Add Invalidate to NCControl because when we swith the enabled property, the control is not repaint automatiquely, we have to add parent invalidate.
3- Support TAction.