开发者

.NET Compact Framework: define default size to a custom control

开发者 https://www.devze.com 2022-12-13 18:57 出处:网络
I\'m developing a winform Windows Mobile 5.0 or above application with .NET Compact Framework 2.0 SP2 and C#.

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!


There are two ways to do it:

  1. Override the default Size property and assign this Attribute to it:

    [DefaultValue(typeof(Size), "500, 500")]
    
  2. Set the default size you want within the constructor.

0

精彩评论

暂无评论...
验证码 换一张
取 消