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.
Unfortunately, activation email could not send to your email. Please try again.

Changing XPMenu Bar''s Background

Thread ID:

Created:

Updated:

Platform:

Replies:

23174 Jan 5,2005 11:40 PM Jan 7,2005 02:05 PM Windows Forms 5
loading
Tags: Tools
Administrator [Syncfusion]
Asked On January 5, 2005 11:40 PM

I''m trying to change the background color of an XPMenu Bar. There are some instructions in message #18770, but I implemented it as: bar1.DrawBackground += new PaintEventHandler(bar_DrawBackground); CommandBarExt cmdbar = bar1.Manager.GetBarControl(bar1) as CommandBarExt; BarControlInternal bci = cmdbar.BarControl; bci.Paint += new PaintEventHandler(BarControl_Paint); But cmdbar is "null". I''m using this in a demo very soon... Thanks so much, Dan

Administrator [Syncfusion]
Replied On January 7, 2005 10:19 AM

Hi Dan, Yes, it is possible to draw the background of a Bar as exlained in the following forum post : DrawBackground event in Bar class The XPMenus.Bar internally uses the CommandbarExt and hence it cannot be null as long a Bar exists on the form. Could you please send us a test sample that shows this issue ? We appreciate your cooperation. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On January 7, 2005 10:43 AM

Ahhh. It seems that it initiailzies the Bar after _Load, so I need to do that initialization later. Is there a particular step during a form''s setup where it is guaranteed to be safe?

Administrator [Syncfusion]
Replied On January 7, 2005 10:46 AM

(The sample in the linked message gives a 404 Not Found)

Administrator [Syncfusion]
Replied On January 7, 2005 11:33 AM

I think I''ve figured it out. For anyone else''s future reference: private void childFrameBarManager1_BarControlBindingChanged(object sender, Syncfusion.Windows.Forms.Tools.XPMenus.BarControlBindingChangedArgs args) { if(args.ChangeType==Syncfusion.Windows.Forms.Tools.XPMenus.BarControlBindingChangeType.Parented) { Bar bar = args.Bar; Control barcontrol = args.BarControl; bar.DrawBackground += new PaintEventHandler(bar_DrawBackground); CommandBarExt cmdbar = barcontrol as CommandBarExt; BarControlInternal bci = cmdbar.BarControl; bci.Paint += new PaintEventHandler(BarControl_Paint); } else _log.Debug("BCBC BC null"); }

Administrator [Syncfusion]
Replied On January 7, 2005 02:05 PM

Hi Dan, Thanks for sharing this information with us. The sample in the above mentioned forum post can be accessed at : XPMenus Bar Painting Sample We appreciate your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;