Default Padding for XtraLayoutControl items

by Miha Markič 8. October 2006 16:13

[DevEx] 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.

Tags:

DevExpress | .net

Comments (2) -

Vatroslav Mihalj
Vatroslav Mihalj
10/10/2006 12:02:42 PM #

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 Smile
P.S.
Hope you didn't spend a fortune on GPRS roaming this year, checking your mail

Reply

Miha Markic
Miha Markic
10/10/2006 12:29:07 PM #

Hej Vatroslav,

Fortunatelly I don't travel much lately Smile 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

Reply

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Miha Markic

About me
Righthand
 
Microsoft MVP
 
Developer Express' DXSquad
INETA Country Leader for Slovenia
INETA Country Leader for Slovenia

Slovene Developer Users Group Lead
Friends of Red-Gate
LLBLGenPro Partner

Miha currently works as a free lance consultant and software developer specialized in .net area.
He graduated in Computer and information science at the University of Ljubljana, Slovenia. He has accumulated experience in various programming languages such as Java, Visual Basic 3-6 (MCP), Visual C++, Delphi, C# and VB.Net through years.
He has experience in practically all (technical) stages of project development, including planning, framework development, user interface, business processes, as well as testing and documenting. He has worked on big and small projects in Slovenia and abroad (e.g. participated in completing level 3 IS for the Nucor steel plant, Hertford, USA).
Currently he enjoys programming in .net environment using C#. Since 2000 he has been active in Developer Express' DX Squad and has been ECDL trainer and tester. He also gives lectures on conferences and other events in Slovenia.

Month List

Tag cloud

Most comments

Dan Dan
4 comments
ca Canada
Thomas Thomas
3 comments
de Germany
Sebastian Sebastian
1 comments
ca Canada

RecentComments

Comment RSS