The help for the BarItem.ID property states, "Should be unique among all the BarItems in a BarManager, if added to a BarManager." But, can somebody please tell me if it is important to use the same value for the ID property between different instances of the application? For example, if I set BarItem1.ID = "1" and then exit the app (at which time the menu state is serialized), do I need to make sure that BarItem1.ID is set back to "1" when the app is restarted, or could I set BarItem.ID to any other unique value?
Also, if I can use any unique value when the app is restarted, then why not just generate a unique value in the constructor? For example, do something like this:
Private idValue As Long = 0
Public Sub New(...)
Me.ID = idValue.ToString
idValue += 1
Thanks for any help.
ADAdministrator Syncfusion Team April 11, 2004 03:12 AM
I have requested the development team for more information on BarItem.ID property, and will update you on this as soon as possible. We appreciate your patience and cooperation.
LLLance LevendowskiApril 11, 2004 08:29 PM
Sounds good. I''ll keep checking back periodically.
ADAdministrator Syncfusion Team April 13, 2004 11:35 AM
The BarItem.ID is a unique value generated by the BarItem class. This ID is used to store/restore the state information of that particular BarItem when the menu is persisted/depersisted. If you wish to explicitly set ID values before persisting menu state information, in that case, you would also have to explicitly set the same ID values once again before restoring the persisted state information. Any changes in the ID value will not restore the persisted state correctly. In case of multiple instances of the application, BarItem information will not be overwritten since they will be scoped under the MainFrameBarManager''s persistence ID which is always unique. Please let me know if you need nay other information.
LLLance LevendowskiApril 13, 2004 08:55 PM
Thank you for your help on this issue. I create many of my menu objects dynamically in response to values that the user can modify (such as an array of user-defined colors). Therefore, using the same ID could be problematic. I will submit a Direct-Trac incident if I can not come up with a solution.
ADAdministrator Syncfusion Team April 14, 2004 04:57 AM
Thanks for the update. The BarItem.ID gets automatically generated (unique value based on the BarItem''s Text value), even if you were to create your menus and toolbars dynamically. As long as you do not explicitly change the ID value, our XPMenus framework will take care of this while persisting/depersisting menu state information. However, please feel free to create a DirectTrac incident if you need any assistance. We appreciate your interest in Syncfusion products.