Nasir Mahmood
Nasir Mahmood

Reputation: 1505

Define property like margin in user control

I want to define a property in user control which is similar margin property, how can i define it ? so that it will show All,Left,top,right,bottom when expanded in designer.

Upvotes: 0

Views: 487

Answers (1)

Marco
Marco

Reputation: 57593

Margin property is defined as a struct:

public struct Padding
{
    public int All { get; set; };
    public int Bottom { get; set; }
    public int Left { get; set; }
    public int Right { get; set; }
    ...
}

So you can define your property as Padding or like a custom struct looking like this one.

Upvotes: 1

Related Questions