Category: WPF

Transforms in WPF

Transforms are a great way to change the appearance of controls in WPF in cases where styles and templates usually fall short. The source code comes from a book published in Czech as “Mistrovstvi ve WPF” ( RIP – this server did not even survive its own hosting.) and in English as Applications = Code …

Read More Transforms in WPF

The Printer Refuses to Print a Visual Object

Last night, just before going to bed, I ran into an interesting problem. I had this code (I did not modify it in any way, it comes from the book Applications = Code + Markup): C#//—————————————————- // PrintaBunchaButtons.cs (c) 2006 by Charles Petzold //—————————————————- using System; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; namespace …

Read More The Printer Refuses to Print a Visual Object

How to Create a Basic Layout in WPF Just Like in Windows Forms

Whenever I started an application in Windows Forms (WF), the first thing I did was add controls in the following order: ToolBar – a drop-down, nestable menu that usually contains most of the program’s features ToolStrip – a row of buttons for the most frequently used actions StatusStrip – information about the state of the …

Read More How to Create a Basic Layout in WPF Just Like in Windows Forms

Layouts in WPF

StackPanel Works the same way as FlowLayoutPanel in Windows Forms. In a vertical arrangement, each item fills the full width of the element it belongs to. Each element is exactly as tall as its content. The default arrangement is vertical. XML<StackPanel Orientation="Vertical"> <!– Vertical is the default –> <Label Background="Red">Red 1</Label> <Label Background="LightGreen">Green 1</Label> <StackPanel …

Read More Layouts in WPF