-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Setting Dark mode #4
Comments
Hello, I don't know much about making the client areas of Windows Forms windows use dark mode, sorry. I think older versions of Git Extensions 3.x did this nicely, although it was temporarily disabled in the latest 4.0. Most of the other solutions I've seen involve using MahApps or other UI frameworks with WPF. |
can you make an example using Git extensions |
No, I don't know how the people working on the Git Extensions program accomplished this, I just know it's an open-source project which faced and solved the same sort of problem you're talking about. Their codebase may be a good starting point for figuring out techniques to make a dark UI in Windows Forms. |
can we enable this at runtime when the uses clicks on the checkBox to enable and disable it |
Great idea. That will be possible. First I have to make the "called too late" error check only run the first time for a given window. Otherwise it will throw an exception when the checkbox is clicked. Once I develop and release that fix, you will be able to call |
…indow is visible without throwing an InvalidOperationException
ok that would be good can you release an example as well for checkbox please also is there a way to add it to multiple Forms though is the next question |
To change multiple forms themes all at once, you can do the following.
|
yer i am trying to use the checkBox call so ill wait for the updated example |
I was able to add this checkbox behavior to the
|
i think there is a bug unless its the version of windows 10 i'm on because the bar does not change color
|
I've seen that title bar visual glitch before. I forget exactly how I fixed it, but I think it had to do with calling the methods earlier. You can try calling |
so i need to set the form in dark mode before i can change |
this is my Program file `static void Main()
|
Sorry this is hitting some roadblocks. I will try to take a look soon and see if I can figure out what may be happening and any suggestions I can offer. |
ok no worries seem weird |
hey I was wondering how you went |
It looks like that demo app I posted has an issue where the subsequent theme changes using the checkbox after first load don't take effect until you blur and refocus the window, and this happens on Windows 10 1809 but not Windows 11 22H2. I think this means the DarkNet library is missing a native DLL call that I didn't understand or seemed superfluous when I was porting the logic from the win32-darkmode example C++ application. I'll need to figure out what method call is missing and when to call it. |
I believe I've fixed the issue with not being able to repeatedly change the process or window themes after the form has already been shown. This has been released as version 2.1.0 on NuGet Gallery. The WPF and Windows Forms demo apps have also been updated to show the ability to change the process theme after the window is already visible using a checkbox that cycles between the |
i can not seem to get it to work when i click on settings from my main form and click on dark mode nothing happens and its already dark mode before i click but not all the groupboxes or anything are in dark mode just the form |
If the title bar is already dark then that's good, it means this library is working. Keep in mind that this library does not make the client areas of any windows dark, including controls like groupboxes. It only changes the title bar. You have to style the contents of the window yourself. You can try changing the groupbox's |
hey mate any chance you could tell me where to add dark mode for multiple forms and if the forms have groupbox in them ect i could only just get the title bar in dark mode
The text was updated successfully, but these errors were encountered: