views:

290

answers:

1

Hello.

I'm developing a winform Windows Mobile 5.0 or above application with .NET Compact Framework 2.0 SP2 and C#.

I'm wondering if there is a way to set a default size of a custom control. When I drop it over the form (on the designer) it is always getting 200x200 as its default size.

Any advice?

Thank you!

+1  A: 

There are two ways:

Overwriting the default Size-Property and assigning this Attribute to it:

[DefaultValue(typeof(Size), "500, 500")]

Or setting the Default Size you want within the contructor.

Bobby
I should add that for the Compact Framework you might need to decorate this via an .xmta file. You can use this to access design time attributes that aren't compatible with CF and it also helps keep the size of the end .exe down. http://blogs.msdn.com/bluecollar/archive/2007/02/08/adding-compact-framework-design-time-attributes-or-more-fun-with-textboxes.aspx
Quibblesome