We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Change border color and foreground color

Hello,

I use a XpToolBar with Metro-Style.
My question is: Is it possible to change the foreground color from a menu item to white (see attachment) and the color and thickness from the border?

Thanx for your support
Thomas



Attachment: XpToolBar_b02f341a.zip

1 Reply

TB Thirupathi Bala Krishnan Syncfusion Team October 4, 2019 01:54 PM UTC

Hi Thomas,

Thanks for contacting Syncfusion support.

Please find our response as below,
 
 
Query 
Response 
Is it possible to change the foreground color from a menu item to white 
Yes. You can achieve this requirement –“How to change the menu item forecolor while hover the item in toolbar” by setting the fore color to the SelTextColor property.

Please refer the following code sample.
 
 
# Form1.cs 
 
using Syncfusion.Windows.Forms; 
        public Form1() 
        { 
            MenuColors.SelTextColor = Color.White;             
            InitializeComponent(); 
        }

 
 
If you want to customize the menu item text, you should define the value using CustomTextFont property. Please refer the following code sample. 
 
# Form1.cs

 
        public Form1() 
        {  
            InitializeComponent(); 
            this.parentBarItem.BeforePopup += ParentBarItem_BeforePopup; 
        } 
 
        private void ParentBarItem_BeforePopup(object sender, CancelEventArgs e) 
        { 
            foreach (BarItem baritem in this.parentBarItem4.Items) 
            { 
                baritem.CustomTextFont = new Font("Times New Roman", 8.25F); 
            } 
        }

 
 
How to change the color and thickness from the border 
Currently, we don’t have any support to customizing the border of bar items such as border color, border thickness. Already We have logged a feature report to provide support to customize their appearance of bar items. Currently we don’t have any immediate plan to implement the feature. This feature will be included in any of our upcoming release.

 

Please let us know if you need any further assistance.

Regards,
Thirupathi B.
 


Loader.
Live Chat Icon For mobile
Up arrow icon