C
C#ā€¢5w ago
trukafatsum

TransperancyKey and Contrast Issue

Hello everyone, I am working on a transparent form application, and as you can see in the image, color distortions occur in the text. One possible solution that comes to mind is dynamically adjusting the forecolor based on the colors behind the application. However, I haven't figured out how to capture the background colors yet.
No description
8 Replies
trukafatsum
trukafatsumOPā€¢5w ago
One more example: TransperancyKey = White BackColor = White Labels ForeColor = Black
No description
Buddy
Buddyā€¢5w ago
WinForms has never really supported "true" transparency move to WPF or Avalonia (and there you should avoid the designer!)
trukafatsum
trukafatsumOPā€¢5w ago
I see that, so looking a solution for winform. There should be šŸ™‚ By the way, i tried 2-3 times WPF but 0 knowledge xaml. It confused me. May i check avalonia. What do you mean "avoid the designer"?
Buddy
Buddyā€¢5w ago
$rulesofwpf
MODiX
MODiXā€¢5w ago
Rules of WPF:

āŒ Avoid the WPF Designer to eliminate a category of confusing bugs
āŒ Don't rely on Margin as the primary tool for layouts
āŒ Avoid writing UserControls or subclassing to extend a default control -- use Behaviors instead (Microsoft.Xaml.Behaviors.Wpf)

āœ… Write XAML by hand and autoformat with "Ctrl K,D" or XAML Styler
āœ… Rely upon XAML Hot Reload to design your app's UI at runtime
āœ… Use layout controls (Grid, DockPanel, etc) to support proper resizing
āœ… Use data binding to eliminate glue code and state synchronization issues
āœ… Use collection controls and DataTemplate to dynamically create lists of controls
āœ… Learn MVVM to create maintainable apps
āœ… Use the Dispatcher to update controls from non-UI threads
āœ… WPF's default controls can be easily modernized via $wpfuilibs
āœ… Include relevant XAML, code-behind, and ViewModel code for questions when possible
Rules of WPF:

āŒ Avoid the WPF Designer to eliminate a category of confusing bugs
āŒ Don't rely on Margin as the primary tool for layouts
āŒ Avoid writing UserControls or subclassing to extend a default control -- use Behaviors instead (Microsoft.Xaml.Behaviors.Wpf)

āœ… Write XAML by hand and autoformat with "Ctrl K,D" or XAML Styler
āœ… Rely upon XAML Hot Reload to design your app's UI at runtime
āœ… Use layout controls (Grid, DockPanel, etc) to support proper resizing
āœ… Use data binding to eliminate glue code and state synchronization issues
āœ… Use collection controls and DataTemplate to dynamically create lists of controls
āœ… Learn MVVM to create maintainable apps
āœ… Use the Dispatcher to update controls from non-UI threads
āœ… WPF's default controls can be easily modernized via $wpfuilibs
āœ… Include relevant XAML, code-behind, and ViewModel code for questions when possible
Buddy
Buddyā€¢5w ago
The designer that comes with Visual Studio just sets the margin as an absolute position, so when you resize the app or when the size doesn't match the size of the designer the layout will go haywire Margin is the spacing between elements
trukafatsum
trukafatsumOPā€¢5w ago
Oh Avalonia supports cross-platform. I like it. So do you have any suggestion about xaml documantation/education series?
Buddy
Buddyā€¢5w ago
XAML is fairly close to HTML in terms of layout and controls Avalonia (close to WPF): https://docs.avaloniaui.net/docs/basics/user-interface/introduction-to-xaml WPF: https://learn.microsoft.com/en-us/dotnet/desktop/wpf/xaml/?view=netdesktop-9.0 But there

Did you find this page helpful?