41 references to SystemColorMode
Microsoft.VisualBasic.Forms (7)
Microsoft\VisualBasic\ApplicationServices\ApplyApplicationDefaultsEventArgs.vb (2)
24
colorMode As
SystemColorMode
)
38
Public Property ColorMode As
SystemColorMode
Microsoft\VisualBasic\ApplicationServices\WindowsFormsApplicationBase.vb (5)
72
Private _colorMode As
SystemColorMode
=
SystemColorMode
.Classic
197
''' The <see cref="
SystemColorMode
"/> that the application is running in.
201
Protected Property ColorMode As
SystemColorMode
205
Set(value As
SystemColorMode
)
Microsoft.VisualBasic.Forms.Tests (3)
System\Windows\Forms\WindowsFormsApplicationBaseTests.vb (3)
21
ColorMode.Should.Be(
SystemColorMode
.Classic)
22
ColorMode =
SystemColorMode
.Dark
23
ColorMode.Should.Be(
SystemColorMode
.Dark)
System.Windows.Forms (22)
System\Windows\Forms\Application.cs (22)
48
private static
SystemColorMode
? s_colorMode;
247
/// This is the <see cref="SystemColorMode"/> which either has been set by <see cref="SetColorMode(
SystemColorMode
)"/>
248
/// or its default value <see cref="
SystemColorMode
.Classic"/>. If it has been set to <see cref="
SystemColorMode
.System"/>,
254
public static
SystemColorMode
ColorMode => s_colorMode ??
SystemColorMode
.Classic;
269
/// dark mode (<see cref="
SystemColorMode
.Dark"/>), light mode (<see cref="
SystemColorMode
.Classic"/>)
270
/// or to the system setting (<see cref="
SystemColorMode
.System"/>).
273
/// If you set it to <see cref="
SystemColorMode
.System"/>, the actual color mode is determined by the
287
public static void SetColorMode(
SystemColorMode
systemColorMode)
294
SystemColorMode
.Classic => systemColorMode,
295
SystemColorMode
.System => systemColorMode,
296
SystemColorMode
.Dark => systemColorMode,
355
/// It returns <see cref="
SystemColorMode
.Dark"/> if the dark mode is enabled in the system settings,
356
/// <see cref="
SystemColorMode
.Classic"/> if the color mode equals the light, standard color setting.
366
public static
SystemColorMode
SystemColorMode =>
368
?
SystemColorMode
.Dark
369
:
SystemColorMode
.Classic;
406
&& (ColorMode ==
SystemColorMode
.Dark
407
|| (ColorMode ==
SystemColorMode
.System && SystemColorMode ==
SystemColorMode
.Dark));
System.Windows.Forms.Tests (9)
System\Windows\Forms\ApplicationTests.cs (9)
161
SystemColorMode
systemColorMode = Application.SystemColorMode;
163
Application.SetColorMode(
SystemColorMode
.Classic);
165
Assert.Equal(
SystemColorMode
.Classic, Application.ColorMode);
168
Application.SetColorMode(
SystemColorMode
.Dark);
170
Assert.Equal(
SystemColorMode
.Dark, Application.ColorMode);
173
Application.SetColorMode(
SystemColorMode
.System);
174
Assert.False(Application.IsDarkModeEnabled ^ systemColorMode ==
SystemColorMode
.Dark);
175
Assert.Equal(
SystemColorMode
.System, Application.ColorMode);
176
Assert.False(SystemColors.UseAlternativeColorSet ^ systemColorMode ==
SystemColorMode
.Dark);