Sie sind auf Seite 1von 1

C#:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Ink_Pad
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}

private void button1_Click(object sender, RoutedEventArgs e)


{
this.inkCanvas1.Strokes.Clear();
}

private void ButtonCloseClicked(object sender, RoutedEventArgs e)


{
this.Close();
}
}
}

XAML:

<Window x:Class="Ink_Pad.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Ink Pad" Height="550" Width="370" Background="Brown">
<Grid>
<InkCanvas Height="Auto" Margin="9,9,9,68" Name="inkCanvas1" VerticalAlignment="Stretch"
Background="LightYellow" />
<Button Height="23" HorizontalAlignment="Left" Margin="85,0,0,24" Name="button1"
VerticalAlignment="Bottom" Width="75" Click="button1_Click">Clear</Button>
<Button Height="23" HorizontalAlignment="Right" Margin="0,0,72,24" Name="button2"
VerticalAlignment="Bottom" Width="75" Click="ButtonCloseClicked">Close</Button>
</Grid>
</Window>

Das könnte Ihnen auch gefallen