Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.1 kB
2
Indexable
Never
<Window x:Class="YourNamespace.AboutDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="About" Height="200" Width="300">
    <Grid>
        <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
            <TextBlock Text="Your Application Name" FontSize="18" FontWeight="Bold" Margin="0,0,0,10"/>
            <TextBlock Text="Version 1.0" Margin="0,0,0,10"/>
            <TextBlock Text="Copyright © 2024 Your Company" Margin="0,0,0,10"/>
            <Button Content="Close" Width="80" Height="30" Click="CloseButton_Click"/>
        </StackPanel>
    </Grid>
</Window>

using System.Windows;

namespace YourNamespace
{
    public partial class AboutDialog : Window
    {
        public AboutDialog()
        {
            InitializeComponent();
        }

        private void CloseButton_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
    }
}

private void ShowAboutDialog()
{
    AboutDialog aboutDialog = new AboutDialog();
    aboutDialog.ShowDialog();
}


Leave a Comment