Moving from C# -> Windows Forms to WPF
Windows Forms: In the past I've set as a descriptor:
Color gcolorBackDialogBox;
Color gcolorForeDialogBox;
Under dlg_Load() I've defined them as:
gcolorBackDialogBox = this.BackColor;
gcolorForeDialogBox = this.ForeColor;
Under a function I've used them as:
gLBlStatus.BackColor = gcolorBackDialogBox;
gLBlStatus.ForeColor = gcolorForeDialogBox;
where gLBlStatus is the name of a label on a dialog box. This sets the label to the same color as the dialog box.
WPF: I'm converting to C# -> WPF. I can change the labels:
gLBlStatus.Background = Brushes.LightGray;
gLBlStatus.Foreground = Brushes.Black;
but can't find a way to replicate the global aspect.
I've found that the default dialog box color is SystemColors.ControlBrushKey ... am unable to find a way to make this nomenclature work.
Windows Forms: In the past I've set as a descriptor:
Color gcolorBackDialogBox;
Color gcolorForeDialogBox;
Under dlg_Load() I've defined them as:
gcolorBackDialogBox = this.BackColor;
gcolorForeDialogBox = this.ForeColor;
Under a function I've used them as:
gLBlStatus.BackColor = gcolorBackDialogBox;
gLBlStatus.ForeColor = gcolorForeDialogBox;
where gLBlStatus is the name of a label on a dialog box. This sets the label to the same color as the dialog box.
WPF: I'm converting to C# -> WPF. I can change the labels:
gLBlStatus.Background = Brushes.LightGray;
gLBlStatus.Foreground = Brushes.Black;
but can't find a way to replicate the global aspect.
I've found that the default dialog box color is SystemColors.ControlBrushKey ... am unable to find a way to make this nomenclature work.
cte677