Click here to Skip to main content
15,881,380 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Please help me to figure out a purpose of this code. Pin
Pew_new4-Sep-18 23:12
Pew_new4-Sep-18 23:12 
GeneralRe: Please help me to figure out a purpose of this code. Pin
Richard MacCutchan4-Sep-18 23:35
mveRichard MacCutchan4-Sep-18 23:35 
GeneralRe: Please help me to figure out a purpose of this code. Pin
Mycroft Holmes5-Sep-18 11:21
professionalMycroft Holmes5-Sep-18 11:21 
GeneralRe: Please help me to figure out a purpose of this code. Pin
Richard MacCutchan5-Sep-18 21:45
mveRichard MacCutchan5-Sep-18 21:45 
AnswerRe: Please help me to figure out a purpose of this code. Pin
Pete O'Hanlon5-Sep-18 0:44
mvePete O'Hanlon5-Sep-18 0:44 
QuestionWPF Grouping and Grouping Adorners Pin
ameenshabeer3-Sep-18 6:29
ameenshabeer3-Sep-18 6:29 
AnswerRe: WPF Grouping and Grouping Adorners Pin
Pete O'Hanlon3-Sep-18 12:40
mvePete O'Hanlon3-Sep-18 12:40 
QuestionSimpliest code: Can't change label "Content" programmatically Pin
Pew_new2-Sep-18 8:28
Pew_new2-Sep-18 8:28 
Hello everyone.

Currently I am trying to work with timers in WPF.

private void Window_Loaded(object sender, RoutedEventArgs e)
       {
           _timer = new System.Timers.Timer();
           _timer.Interval = 1000;
           _timer.Elapsed += OnTimerElapsed;
           _timer.Start();

       }

       int i=0;
       private void OnTimerElapsed(object sender, ElapsedEventArgs e)
       {
           i++;

           label1.Content = i.ToString();

       }


I've got an exception at this string
label1.Content = i.ToString();


What I'm doing wrong with a label?

Thanks in advance!

XAML:
<Label x:Name="label1"  HorizontalAlignment="Center" Margin="2" VerticalAlignment="Center" Height="79" Width="86"/>


modified 3-Sep-18 4:19am.

AnswerRe: Simpliest code doesn't work Pin
Bernhard Hiller2-Sep-18 22:03
Bernhard Hiller2-Sep-18 22:03 
GeneralRe: Simpliest code doesn't work Pin
Pew_new2-Sep-18 23:10
Pew_new2-Sep-18 23:10 
GeneralRe: Simpliest code doesn't work Pin
Richard Deeming3-Sep-18 10:32
mveRichard Deeming3-Sep-18 10:32 
QuestionWPF: Customizing the appearence of a window n XAML Pin
Pew_new28-Aug-18 21:30
Pew_new28-Aug-18 21:30 
AnswerRe: WPF: Customizing the appearence of a window n XAML Pin
OriginalGriff28-Aug-18 21:32
mveOriginalGriff28-Aug-18 21:32 
GeneralRe: WPF: Customizing the appearence of a window n XAML Pin
Pew_new29-Aug-18 0:55
Pew_new29-Aug-18 0:55 
GeneralRe: WPF: Customizing the appearence of a window n XAML Pin
OriginalGriff29-Aug-18 1:04
mveOriginalGriff29-Aug-18 1:04 
GeneralRe: WPF: Customizing the appearence of a window n XAML Pin
Pew_new29-Aug-18 3:07
Pew_new29-Aug-18 3:07 
GeneralRe: WPF: Customizing the appearence of a window n XAML Pin
Richard Deeming29-Aug-18 3:52
mveRichard Deeming29-Aug-18 3:52 
GeneralRe: WPF: Customizing the appearence of a window n XAML Pin
Pew_new29-Aug-18 4:03
Pew_new29-Aug-18 4:03 
GeneralRe: WPF: Customizing the appearence of a window n XAML Pin
Richard Deeming29-Aug-18 4:09
mveRichard Deeming29-Aug-18 4:09 
GeneralRe: WPF: Customizing the appearence of a window n XAML Pin
Pew_new29-Aug-18 4:31
Pew_new29-Aug-18 4:31 
SuggestionRe: WPF: Customizing the appearence of a window n XAML Pin
Richard Deeming29-Aug-18 2:56
mveRichard Deeming29-Aug-18 2:56 
GeneralRe: WPF: Customizing the appearence of a window n XAML Pin
Pew_new29-Aug-18 3:12
Pew_new29-Aug-18 3:12 
QuestionWPF: Can't get what I need to do to get things right (responsive controls). Pin
Pew_new21-Aug-18 5:13
Pew_new21-Aug-18 5:13 
AnswerRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Richard Deeming21-Aug-18 9:59
mveRichard Deeming21-Aug-18 9:59 
GeneralRe: WPF: Can't get what I need to do to get things right (responsive controls). Pin
Pew_new21-Aug-18 22:02
Pew_new21-Aug-18 22:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.