Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No UserControl support #320

Closed
Exorion1er opened this issue Jan 3, 2022 · 2 comments
Closed

No UserControl support #320

Exorion1er opened this issue Jan 3, 2022 · 2 comments

Comments

@Exorion1er
Copy link

Is there any plan to support UserControl in the future ?
Right now, when trying to add a UserControl to my form, because the controls don't like a transparent background, they make a black background instead, which obviously breaks the theme.

@valimaties
Copy link

valimaties commented Jan 3, 2022

Hi @ExoKalork
As I know, writing the code below to your UserControl will set its background as transparent:

protected override CreateParams CreateParams
{
    get
    {
        CreateParams cp = base.CreateParams;
        cp.ExStyle |= 0x20;
        return cp;
    }
}

Example of a Test UserControl:
Test.cs

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

        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x20;
                return cp;
            }
        }
    }

UserControl

@Exorion1er
Copy link
Author

Oh this indeed looks right, thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants