Like many others I've been looking for a solution to this problem and I've decided to try Kim Ho's suggestion inhttp://ko.infragistics.com/community/forums/p/25649/95887.aspx
This has worked reasonably well...
... except for a few issues:
1. The fly-out menu is not stable. If move the mouse back and forth over the boundary between "three" and "A", you'll find a spot where the fly-out menu starts flickering. Sometimes only once, but with some trial and error you'll get it to flicker constantly. There are other such spots, too. How can we avoid this?
2. The shadow is not coming along. For use with the UltraDropDownButton I will hide it, but for a complete solution there should be a way to show it correctly.
3. How can I find out whether a menu has submenus (i.e. needs the space for the right-pointing arrows) or not -- in the CreationFilter. IOW, how can I tell in the CreationFilter whether I'm looking at the pull-down menu (or menu item) or at a fly-out, so that I can adjust for the absence of the arrows?
4. I've found the measurements that I used in my CreationFilter by trial and error, and they're not pixels. What's their unit, and is there a way to retrieve the magic numbers programmatically?
5. Bonus question: Is there a way to make "A" the default menu item (i.e. show it in bold and select it, when the user clicks on "three")?
TIA,Hans
[Composing a message is a pain here:
1. I pasted the screenshot into the message, and it's still (!) showing in the editor, but the Post shows a broken image.
2. I tried to edit the post and add the screenshot as a file. This seems to have worked and the attached .png is showing, but now the sample project .zip is gone. I'm trying to attach it to this comment now...]
Hello,
Thank you for the provided sample.
Is it enough just to move the MenuItems on the right, isn't it ? To do this please replace all the code from AfterCreatedChildElements method of your CreationFilterClass with:
if (parent is TextUIElement && parent.Parent.GetContext().GetType().Name == "ToolMenuItem")
{
parent.Rect = new Rectangle(new Point(parent.Parent.Rect.X + 1, parent.Rect.Y), parent.Rect.Size);
}
Please evaluate this suggestion and let me know if you have any further questions.
Hi Hristo,
Thank you for your reply. I'm attaching the result. It does not flicker, which is great, but having the texts so far to the left with so much white space on the right looks like sloppy design.
[It seems that I can only attach one file at a time, so I'm adding more comments...]
Here's a screenshot of the original menu without any fiddling, except for making the menu background red, which shows the icon area.
Your suggestion benefitted from a left-over line in my sample code (near the top of Form1.Configure()) that set it to White, but the menu item background is actually not quite white and there is a trace of the border to the right of the icon area in your solution. Where could I find the menu item background color in order to set the menu background to the exact same color?
[continued...]
I've tried to move the menu item captions only half-way to the left with
parent.Rect = new Rectangle( new Point( (parent.Rect.X + parent.Parent.Rect.X)/2, parent.Rect.Y ), parent.Rect.Size );
but this causes odd behavior: the captions start to move left and right randomly as you move the mouse over them.
So. to wrap it up, your proposed solution is about as good as just setting the menu background to white, i.e. we have a large white space either on the left or on the right of the captions. This would work for a company-internal tool, but neither is really good enough for public release.
Hans
Hello ,
After further research I found that you could set ImgeSizeSmall to zero size in order to decrease IconArea and you wouldn’t need to use CreationFilter. In your sample you could use code like:
mgr.ImageSizeSmall = new System.Drawing.Size(0, 0);
Please let me know if this works for you.
Yes, ImageSizeSmall is nice. I can even set it to Size(-7, 0) to make the image area disappear completely.
Thank you for your help!