Heranca de Proprieade Usercontrol Para Form VB.NET

Asked

Viewed 109 times

0

How do I make a form inherit the same properties as a user control by dragging it from the controlbox to the form?

Example: I created a Usercontrol with FormBorderStyle = none, I compiled and managed the DLL inside the visual studio, added this new control to my Toolbox, and added it to Form. While dragging Toolbox I wanted you to already define that this Form will have FormBorderStyle = none.

1 answer

0

Solved

 public partial class UserControl1 : UserControl
    {
    public UserControl1()
    {
        InitializeComponent();            
    }

    protected override void OnLoad(EventArgs e)
    {
        this.ParentForm.FormBorderStyle = FormBorderStyle.None;
        base.OnLoad(e);
    }
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.