Basic DialogBox : Dialog « Windows Presentation Foundation « C# / CSharp Tutorial






<Window x:Class="Styles.BasicDialogBox"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="BasicDialogBox" Height="300" Width="300" MinHeight="150" MinWidth="200">
  <Window.Resources>
    <Thickness x:Key="BasicMargin" Bottom="5" Top="5" Left="5" Right="5"></Thickness>
  </Window.Resources>
  <DockPanel LastChildFill="True">
    <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal">
      <Button Margin="{StaticResource BasicMargin}" Padding="3,3,3,3">OK</Button>
      <Button Margin="{StaticResource BasicMargin}" Padding="3,3,3,3">Cancel</Button>
      
    </StackPanel>
    <TextBox DockPanel.Dock="Top" Margin="10">This is a test.</TextBox>
  </DockPanel>
</Window>
WPF Basic Dialog Box








24.73.Dialog
24.73.1.Basic DialogBoxBasic DialogBox
24.73.2.About DialogAbout Dialog
24.73.3.About Dialog - Font Properties on RootAbout Dialog - Font Properties on Root
24.73.4.Display window as dialogDisplay window as dialog
24.73.5.Close a dialog after pressing enter in a TextBox