D
dabina2018
Guest
I am working on a WPF project in C#, I am receiving the following error:
CS0102 The type 'MainWindow' already contains a definition for 'BtnCanvas_Click'.
Here is my code:
namespace WPFTutorial
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.Title = "Hello World";
this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
}
private void Window_MouseMove(object sender, MouseEventArgs e)
{
Title = e.GetPosition(this).ToString();
}
/// middle screen buttons
///
private void Button1_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("The App is Closing");
this.Close();
}
private void BtnOpenFile_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog openDlg = new OpenFileDialog();
openDlg.ShowDialog();
}
private void BtnSaveFile_Click(object sender, RoutedEventArgs e)
{
SaveFileDialog saveDlg = new SaveFileDialog();
saveDlg.ShowDialog();
}
// navigation buttons
//
private void BtnCanvas_Click(object sender, RoutedEventArgs e)
{
Canvas pg = new Canvas();
pg.Show();
//this.Content = new Uri("Canvas.xaml", UriKind.Relative);
//this.Content = new Canvas();
}
private void BtnUKN_Click(object sender, RoutedEventArgs e)
{
Canvas pg = new Canvas();
// this.Content = new Canvas();
}
}
}
Any help is appreciated.
Continue reading...
CS0102 The type 'MainWindow' already contains a definition for 'BtnCanvas_Click'.
Here is my code:
namespace WPFTutorial
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.Title = "Hello World";
this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
}
private void Window_MouseMove(object sender, MouseEventArgs e)
{
Title = e.GetPosition(this).ToString();
}
/// middle screen buttons
///
private void Button1_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("The App is Closing");
this.Close();
}
private void BtnOpenFile_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog openDlg = new OpenFileDialog();
openDlg.ShowDialog();
}
private void BtnSaveFile_Click(object sender, RoutedEventArgs e)
{
SaveFileDialog saveDlg = new SaveFileDialog();
saveDlg.ShowDialog();
}
// navigation buttons
//
private void BtnCanvas_Click(object sender, RoutedEventArgs e)
{
Canvas pg = new Canvas();
pg.Show();
//this.Content = new Uri("Canvas.xaml", UriKind.Relative);
//this.Content = new Canvas();
}
private void BtnUKN_Click(object sender, RoutedEventArgs e)
{
Canvas pg = new Canvas();
// this.Content = new Canvas();
}
}
}
Any help is appreciated.
Continue reading...