Hi everybody,
I hope i posted this in the right section.
I'm trying to learn C# with the book Head First C# and i'm having a great time doing this, but i'm stuck at the moment.
I'm in chapter 2 around page 187/188 "Add a textbox to your control". I have put in the label, textbox and textblock like the book says. When i have to run my program the book shows that there will be an exception and that i have to find out where the problem is.
When i run the program i don't get the exception, but the program runs and shows a screen with my label, textbox and textbox like i put in . I really have no clue at this moment and can't find what i'm doing wrong.
I deleted the whole project and started again, but i keep getting the same issue.
It's a bit frustrating because i had such a great time and it's no problem that i will run into problems during my learning, but to be stuck like this is not fun anymore.
My code say's the following:
The book on the otherhand says:
And when i run the program i don't get the exception above but i get the following:
I hope i posted this in the right section.
I'm trying to learn C# with the book Head First C# and i'm having a great time doing this, but i'm stuck at the moment.
I'm in chapter 2 around page 187/188 "Add a textbox to your control". I have put in the label, textbox and textblock like the book says. When i have to run my program the book shows that there will be an exception and that i have to find out where the problem is.
When i run the program i don't get the exception, but the program runs and shows a screen with my label, textbox and textbox like i put in . I really have no clue at this moment and can't find what i'm doing wrong.
I deleted the whole project and started again, but i keep getting the same issue.
It's a bit frustrating because i had such a great time and it's no problem that i will run into problems during my learning, but to be stuck like this is not fun anymore.
My code say's the following:
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 ExperimentWithControls
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void numberTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
}
}
}
The book on the otherhand says:
And when i run the program i don't get the exception above but i get the following:
Last edited by a moderator: