Hi,
I have decided to start learning c# and wpf today and am sure there will be 100 more posts to follow :)
I plan to follow a few tutorials tonight on here but while I am at work I thought I would have a quick play around.
I have created a page with some buttons, each button is to spawn a new form.
The first button will always work but once i add several more I start getting errors.
Could I have an explanation as to why this is?
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
Window win = new bapp();
win.Show();
}
private void button2_Click(object sender, RoutedEventArgs e)
{
Window win = new Ulinks();
win.Show();
}
private void button3_Click(object sender, RoutedEventArgs e)
{
Window win = new tasks();
win.Show();
}
private void button4_Click(object sender, RoutedEventArgs e)
{
Window win = new settings();
win.Show();
}
}
}
UPDATE 1
I get the following error for all other buttons
Cannot implicitly convert type 'Dehub.Ulinks' to 'System.Windows.Window' C:\Development\c#\Dehub\Dehub\MainWindow.xaml.cs 36 26 Dehub
UPDATE 2
Here is the XMAL of Ulinks
<Page x:Class="Dehub.Ulinks"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="Ulinks">
<Grid>