Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Control layout...what's the trick? Collapse All
Subject Author Date
Lionel Keene Nov 19, 2009 - 9:46 AM

I’ve added a Ribbon control to my form, and when I tried adding a control or two to the group box on the ribbon tab I found it impossible to arrange the control layout. For example, adding a Label control to the group box by dragging from the ToolBox window places the Label in the top center of the group box. It isn’t possible to drag the label to another location within the group box as I normally would using WinForms Designer within VS as every time I try to drag it to a new location (say, to the vertical center of the group box) it snaps back to its default placement. What is the concept behind the layout behavior and what is the proper way to go about arranging my controls the way I want in the ribbon group boxes? Is there a little article somewhere? Do I have alignment options? Thank you.

Otherwise, so far the Ribbon looks great! Very impressive.

-L

Technical Support Nov 19, 2009 - 7:06 PM

We will prepare a sample illustrating a custom arrangement of the controls inside the ribbon group. We will provide it in 24 hours. Stay tuned.

Lionel Keene Nov 19, 2009 - 5:58 PM

I’ve given up on the Panel approach and am trying to work with the Ribbon control the way it "wants" me to, but I’m still having a heck of a time. I see in your RibbonGUI demo that you have a group labeled "Font" when the "Home" tab has focus. In the Font group you have two Label controls with drop down list box controls right next to them. They appear to have their vertical centers aligned.

I’ve been trying for the last hour (!!!) to duplicate this simple arrangement and I cannot. First a drop a Label control onto the group and change its Text property to whatever. The Label is now centered in the upper portion of the group and cannot be moved or resized. I then drop a Textbox control onto the group and it appears centered directly beneath the Label control. It cannot be moved or repositioned. There is no (intuitive) way that I can see to move the Textbox such that it is to the right of the Label control.

I’m starting to think that I have some fundamental misunderstanding of how this control is meant to be used. Does this Ribbon control, in fact, allow for unique arrangements of controls on its surface? If so, how? If not, how does one know a priori what the permissible patterns are?

-L

Technical Support Nov 20, 2009 - 2:34 PM

Try the following sample

Custom panel-based container

It uses a custom container inherited from Elegant.Ui.Panel and allows you to arrange child controls arbitrary. Please let us know if id does not help.

Lionel Keene Nov 20, 2009 - 3:57 PM

I see now. I had actually tried to change the Back Color property of the Panel to Transparent earlier to improve appearance, but I was trying to do it through the property window and of course was unable to. I didn’t think to derive from the Panel class and SetStyle(...). This will do I believe.

Thanks for doing that!

-L

Technical Support Nov 19, 2009 - 1:50 PM

Any ribbon group is compliant with the layout presented in Microsoft Office applications. In order to manually arrange controls, just add a Panel to your ribbon group and use it as a container for your controls.

Lionel Keene Nov 19, 2009 - 4:44 PM

You mean the controls in each of the Ribbon groups are only allowed to adopt a certain (prefixed) configuration?! I was unaware of this limitation...maybe this won’t work for me after all.

I’ve tried the Panel control trick but, unfortunately, the Panel is also subject to the snapping behavior where it is pinned to its initial location and can only be resized and not repositioned within the group box. I suppose the idea is to expand the dimensions of the Panel such that it fills the group box and then start dropping your controls onto it. This ends up looking utterly horrid and would be a terrible shame to do since this ribbon control looks so nice out-of-the-box. Is there no other way around this?

-L