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.

Want to dynamically increase size of BarItem used as a menu

Thread ID:

Created:

Updated:

Platform:

Replies:

24658 Feb 8,2005 04:43 PM Feb 10,2005 05:56 PM Windows Forms 4
loading
Tags: Tools
Justin Koh
Asked On February 8, 2005 04:43 PM

I have a DropDownBarItem used as an undo menu in my application. When it drops down, I have the list of actions that can be undone. The very last item is a special baritem that is disabled. I update the text whenever the other bar items in the menu get highlighted. It displays the number of actions that will be undone (like Microsoft Word). My problem is when the number of actions goes > 10. The text of the last item was "Undoing 9 action(s)". When it becomes "Undoing 10 actions(s)", the last parentheses gets dropped. How can I force the baritem to resize when the text on it has changed?

Administrator [Syncfusion]
Replied On February 9, 2005 09:44 AM

Hi Justin, I''m having a little trouble understanding what you''re trying to do. I have a couple questions for you: 1) Is there any reason you''re using a disabled BarItem instead of a StaticBarItem? 2) How exactly are you using the DropDownBarItem? Wouldn''t hosting BarItems in a ParentBarItem be easier? I''ve noticed that BarItems in ParentBarItems dynamically resize, if that helps. Regards, Gregory Austin Syncfusion, Inc.

Justin Koh
Replied On February 9, 2005 12:36 PM

There is no reason. I could switch to a StaticBarItem. The reason that I''m using a DropDownBarItem is that I want to handle a click on the button (to do one undo) as well as having a drop down list of the undo items. Things will resize if I only highlight item 10, but most people scroll from item 1 - 10.

Administrator [Syncfusion]
Replied On February 10, 2005 12:16 PM

Hi Justin, There''s a property in ParentBarItem that allows it to operate as a DropDown. If you set ParentStyle=DropDown then it''ll function that way. Regarding the resize, I''m not aware of any way to force a BarItem to resize. I can think of two possible workarounds for this: 1) Include a StaticBarItem that''s wider than your BarItem needs to be. This should cause the BarItem to be drawn at a larger size as soon as the DropDown appears. A simple picture of a line would work well. 2) Instead of setting the text to "Undo 1 Item(s)", set the text to "Undo 01 Item(s)" Regards, Gregory Austin Syncfusion, Inc.

Justin Koh
Replied On February 10, 2005 05:56 PM

Thanks for your help. I actually am using a parentbaritem with the dropdown property set. I''ll try your suggestion of the static bar item later.

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.

;