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

Disabled ComboBox is white #67

Open
panyann opened this issue Nov 12, 2024 · 3 comments
Open

Disabled ComboBox is white #67

panyann opened this issue Nov 12, 2024 · 3 comments

Comments

@panyann
Copy link

panyann commented Nov 12, 2024

Hello,
I have a small issue in v1.18.12, the disabled (by the code) ComboBox is white:
image

I noticed that there is a fix for that in the DarkModeCS, but it doesn't work:

// Fixes a glitch showing the Combo Backgroud white when the control is Disabled:
if (!control.Enabled && this.IsDarkMode)
{
				comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
}

It works correctly when I change it to:

// Fixes a glitch showing the Combo Backgroud white when the control is Disabled:
if (this.IsDarkMode)
{
				comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
}

image

Can you check this? Thanks.

@kachnitata
Copy link
Contributor

I am out of office right now, but looking at the description above, it seems the .Enabled is being evaluated at the time of dark theme application. If the control is enabled orginally and disabled afterwards, it is not reflected.... So one option would be handling Control.EnabledChanged, the other, probably most clear, would be handlingControl.OnPaint....

@BlueMystical
Copy link
Owner

Thanks for reporting this glitch, i'll look to fix it.
Regards.

@daves0
Copy link

daves0 commented Nov 16, 2024

I resolved this by adding the following lines immediately after "control.ControlAdded += controlControlAdded;" in DarkModeCS.cs

// handle controls getting enabled/disabled dynamically
control.EnabledChanged += (object? sender1, EventArgs e1) =>
{
	if (sender1 != null)
	{
		ThemeControl((Control)sender1);
	}
};

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

4 participants