Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Problem sa Timer-a u VS2010

[es] :: .NET :: .NET Desktop razvoj :: Problem sa Timer-a u VS2010

[ Pregleda: 2167 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

ha_23

Član broj: 282489
Poruke: 219
94.100.108.*



+4 Profil

icon Problem sa Timer-a u VS201006.10.2011. u 12:39 - pre 151 meseci
Vako, dolu navedzeni kod u C# mi vadzi gresku u VS2010, ranije u vs2008 ovo radilo bes greske, sta e problem?

"Error 1 Only assignment, call, increment, decrement, and new object expressions can be used as a statement Line 23 17"
"Error 2 Only assignment, call, increment, decrement, and new object expressions can be used as a statement Line 27 17"

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication9
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (timer1.Enabled == false)
            {
                timer1.Enabled == true;
            }
            else
            {
                timer1.Enabled == false;
            }
        }
    }
}
 
Odgovor na temu

AMD guy
Miroslav
.NET developer

Član broj: 128930
Poruke: 1007

Sajt: www.its.edu.rs


+38 Profil

icon Re: Problem sa Timer-a u VS201006.10.2011. u 12:45 - pre 151 meseci
Preporucujem ti da pogledas sta ta greska znaci, i onda opet postavi pitanje
http://msdn.microsoft.com/en-u...ry/k626bk8b%28v=VS.100%29.aspx
http://i.imgur.com/V3feW.jpg
http://on.wsj.com/H9yjz6 -- India Graduates Millions, but Too Few Are Fit to Hire
 
Odgovor na temu

nikitaGradov
Beograd

Član broj: 223576
Poruke: 206
92.244.132.*



+3 Profil

icon Re: Problem sa Timer-a u VS201006.10.2011. u 12:49 - pre 151 meseci
Citat:
ha_23: Vako, dolu navedzeni kod u C# mi vadzi gresku u VS2010, ranije u vs2008 ovo radilo bes greske, sta e problem?

"Error1Only assignment, call, increment, decrement, and new object expressions can be used as a statement Line 2317"
"Error2Only assignment, call, increment, decrement, and new object expressions can be used as a statement Line2717"

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication9
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (timer1.Enabled == false)
            {
                timer1.Enabled == true;
            }
            else
            {
                timer1.Enabled == false;
            }
        }
    }
}



if (timer1.Enabled == false)
{
timer1.Enabled == true;
}
else
{
timer1.Enabled == false;
}
ne moze, u bloku od if-a i else-a , da stoji ' == ' (znaci, ispravno je: 'timer1.Enabled = true', a ne 'timer1.Enabled == true')?
Nije ovo moglo, nikako, da radi ni u jednoj verziji Visual Studio-a (ni 2005, ni 2008, ...) ...
Programming is fun, but writing good software is hard ...
 
Odgovor na temu

ha_23

Član broj: 282489
Poruke: 219
94.100.108.*



+4 Profil

icon Re: Problem sa Timer-a u VS201006.10.2011. u 12:54 - pre 151 meseci
Tako e pronaso sam gresku, napisao == umesto =, kako nisam zaprimetio :)
Pozdarv :)
 
Odgovor na temu

[es] :: .NET :: .NET Desktop razvoj :: Problem sa Timer-a u VS2010

[ Pregleda: 2167 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.