Welcome to RightHand's community place Sign in | | Help

Default Padding for XtraLayoutControl items

Developer Express XtraLayoutControl sets its items default Padding to 5;5;5;5 (left, right, top, bottom) which might not be always desired value and there is no easy way to alter this default setting as per this support center entry.

However, there is a solution that is fairly easy to implement. Just derive a class from XtraLayoutControl and override CreateLayoutItem method as shown in this piece of code:

public class RhLayoutControl: LayoutControl { public override BaseLayoutItem CreateLayoutItem(LayoutGroup parent) { BaseLayoutItem item = base.CreateLayoutItem(parent); item.Padding = new Padding(5, 5, 2, 2); return item; } }

Here I set default Padding for an item to (5, 5, 2, 2) but you can set is as you wish. Of course, instead of XtraLayoutControl you would have to use RhLayoutControl to make this trick work.

Published 8. oktober 2006 15:13 by Miha Markic
Filed under: ,

Comments

# re: Default Padding for XtraLayoutControl items

10. oktober 2006 11:02 by Vatroslav Mihalj
Thnigs are going pretty smooth for you, I see, apart from the circus with VS2005SP1 and 3rd Party Toolbox. Hope to see you soon in Zagreb, to share a few of your tricks. We got Dejan Sarka this month (see URL), you are the next one :) P.S. Hope you didn't spend a fortune on GPRS roaming this year, checking your mail

# re: Default Padding for XtraLayoutControl items

10. oktober 2006 11:29 by Miha Markic

Hej Vatroslav,

Fortunatelly I don't travel much lately :-) so I don't bother with GPRS roaming (which is crazy expensive).

Dejan is a very entertaining speaker, I am sure he will do a great presentation.

Hehe, I am the next one :-P

Anonymous comments are disabled