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.

Force Parent bar item to change image

Thread ID:

Created:

Updated:

Platform:

Replies:

44669 May 31,2006 10:04 AM Jun 5,2006 01:51 AM Windows Forms 9
loading
Tags: Tools
Administrator [Syncfusion]
Asked On May 31, 2006 10:04 AM

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 05:14 AM

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 08:26 AM

Hi Wye, I have tested this issue using v.4.2.0.27 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 10:26 AM

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

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

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

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

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 03:09 AM

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 05:47 AM

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 :)

WindowsApplication137.zip

J.Nagarajan [Syncfusion]
Replied On June 2, 2006 11:18 AM

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 01:51 AM

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

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.

;