I'm using Visual Studio 2013
So for the most part I'm getting an error when I run the code below, the code is an attempt to create a label once a button is clicked, the label's content comes from a textbox called contentEventInput.
The error comes after I click the button to create the label.
An unhandled exception of type 'System.ArgumentException' occurred in PresentationCore.dll
private void btnEvent_Click(object sender, RoutedEventArgs e)
{
Label eventCreateText = new Label();
eventCreateText.Foreground = new SolidColorBrush(Colors.White);
eventCreateText.Content = contentEventInput;
eventCreateText.Margin = new Thickness(0, 440, 836, 40);
ephGrid.Children.Add(eventCreateText);
}
Do any of you know how to fix this?