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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Force Parent bar item to change image

Thread ID:





44669 May 31,2006 02:04 PM UTC Jun 5,2006 05:51 AM UTC WinForms 9
Tags: Tools
Administrator [Syncfusion]
Asked On May 31, 2006 02:04 PM UTC

Hi, I have a form which consist of a childframebar manager which consist a TabControlAdv and a ParentBarItem. I''m trying to change the Image of the ParentBarItem when the user click on different tabcontrol. Below are the codes i tried, the image will only change when i mouse over the parentbaritem. Is there something i''ve missed out or any suggestion for this situation? Thanks in advance :) void tabControlAdvMain_SelectedIndexChanged(object sender, EventArgs e) { switch (tabControlAdvMain.SelectedTab.Tag.ToString()) { case "Accessory": pBiNew.ImageIndex = 1; InitDgAccessory(); break; case "Fabric": pBiNew.ImageIndex = 0; InitDgFabric(); break; case "Document": pBiNew.ImageIndex = 3; InitDgDocument(); break; case "Sketch": pBiNew.ImageIndex = 3; InitDgSketch(); break; case "MO": pBiNew.ImageIndex = 4; InitDgMO(); break; } pBiNew.PerformUpdateUI(); }

Administrator [Syncfusion]
Replied On June 1, 2006 09:14 AM UTC

Hi is my question not clear enough? Please do tell me and i''ll try to come up with a better explaination of my situation.

Mano J [Syncfusion]
Replied On June 1, 2006 12:26 PM UTC

Hi Wye, I have tested this issue using v. RC in VS 2003. I was not able to see the problem you have mentioned. In the sample, click File -> New to open a new mdi child. Click on the tabs to change the image on the merged parentBarItem. Please check the attached sample on your side and let you know if you see any problem. Also, let me know the version of Essential Studio and .Net framework version you are using. Regards, Mano F44669.zip

Administrator [Syncfusion]
Replied On June 1, 2006 02:26 PM UTC

Hi Johnson, Thanks for replying. Sorry for missing out the version, i''m currently using and i''m using VS.NET 2005.

Mano J [Syncfusion]
Replied On June 2, 2006 05:06 AM UTC

Hi Wye, Did you check the sample attached in the previous update? We have tested this issue in v. under VS2005. It works fine for us. Thanks, Mano

Administrator [Syncfusion]
Replied On June 2, 2006 06:21 AM UTC

Hi Johnson, I got the list of errors when i try to run the sample you sent me. Error 1 ''Syncfusion.Windows.Forms.Tools.TabControlAdv'' does not contain a definition for ''NavigationControl'' Error 8 ''Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager'' does not contain a definition for ''Font'' Error 9 ''Syncfusion.Windows.Forms.Tools.XPMenus.ParentBarItem'' does not contain a definition for ''CustomTextFont''

Mano J [Syncfusion]
Replied On June 2, 2006 07:09 AM UTC

Hi Wye, Sorry for the inconvenience. These properties are added in the later versions of Essential Studio. You can simply comment out the lines and run the sample. However I have modified the sample and attached it here. Please take a look and let me know if you see the image problem. Regards, Mano F44669.zip

Administrator [Syncfusion]
Replied On June 2, 2006 09:47 AM UTC

Hi Johnson, This time i missed out a very important information, i''m very sorry. I actually have a "New" parentbarItem on the parent form and another one at the child form. And I merge the two parent and child''s "New" parentbaritem together. I''ve attached a sample of what i meant with this post. Thanks in advance :)


J.Nagarajan [Syncfusion]
Replied On June 2, 2006 03:18 PM UTC

Hi Wye, I have tested this issue and it seems to be a bug in Menus. I have logged a bug report # 2169 in this regard. You can track the progress of this issue at this link below : Defect #2169 - Image of a merged ParentBarItem does not get changed when we change it dynamically Please set the visible property of BarItem to false then set ImageIndex property finally set the visible property to true. But you have to get the merged equvalent of that bar because when MainForm is a MDI Container, MergedBars are used instead of original Bars.This is because of Bars from different MdiChild forms can be merged to single Bar. Bar bar = this.childFrameBarManager1.MainFrameBarManager.GetMergedEquivalent(this.bar2, this.bar2); private void tabControlAdv1_SelectedIndexChanged(object sender, EventArgs e) { Bar bar = this.childFrameBarManager1.MainFrameBarManager.GetMergedEquivalent(this.bar2, this.bar2); switch (this.tabControlAdv1.SelectedTab.Tag.ToString()) { case "page1": //Initially I have set the visibile property of first BarItem to false and then set it to true again bar.Items[0].Visible = false; bar.Items[0].ImageIndex = 0; bar.Items[0].Visible = true; break; } } sample_modified_1.zip Please let me know if you have any questions. Thank you, J.Nagaraj.

Administrator [Syncfusion]
Replied On June 5, 2006 05:51 AM UTC

Thank you so much to you Nagarajan and Mano Johnson for your support and help. :) it works!! Thanks again to you two!!


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon