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

Problem sa Collections Array List

[es] :: .NET :: .NET Desktop razvoj :: Problem sa Collections Array List

[ Pregleda: 2148 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Vinona

Član broj: 160794
Poruke: 16
*.bredband.comhem.se.



Profil

icon Problem sa Collections Array List16.04.2008. u 21:38 - pre 194 meseci
Uradila sam Collection class u windows formi. Kada kliknem nekoliko puta na button 1 treba da mi se izmenjaju u text boxu imena a u drugom text boxu brojevi.
Kada izaberem jedno ime kliknem ba button 2 izbacim ime i ubacim ga u list box. Sa button 3 vracam iz list box ime i broj koji sam ubacila u prvobitno. Imam problem sa button 1, a klikanjem na button 2 mi se napise ime koje sam sama napisala

Code:

 public struct Student
    {
        private string name;
        private int number;

        public Student(string Name, int Number)
        {
            name = Name;
            number = Number;
        }
        public string Name
        {
            get
            { return name;}
            set
            { name = value; }
        }
        public int Number
        {
            get
            {return number;}
            set
            {number = value;}
        }
        public override string ToString()
        {
            return base.ToString();
        }
      }
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            al.Add(new Student("Sonja", 1));
            al.Add(new Student("Maria", 2));
            al.Add(new Student("Anna", 3));
            al.Add(new Student("Lena", 4));
            al.Add(new Student("Maja", 5));
        }
        
        private ArrayList al = new ArrayList();
        
        private void button1_Click(object sender, EventArgs e)
        {
                al.Add("Sonja");
                textBox1.Select();
                textBox2.Select();

        }

        private void button2_Click(object sender, EventArgs e)
        {
        al.Add("Sonja");
        al.Add("Maria");
        listBox1.DataSource = null;
        listBox1.DataSource = al;
        }

        private void button3_Click(object sender, EventArgs e)
        {
        al.Add(al);
        }

        private void button4_Click(object sender, EventArgs e)
        {
         Close();
        }

        }
    }
 
Odgovor na temu

Djoks
Djordje Najdanovic
Software Developer
Azalea Maritime

Član broj: 1630
Poruke: 268
85.94.122.*

Sajt: www.azalea-maritime.com


Profil

icon Re: Problem sa Collections Array List16.04.2008. u 22:31 - pre 194 meseci
uh, uh - da budem iskren - nije mi jasno šta se ovdje događa, ili šta treba da se dogodi. :(
Možeš li još jednom da napišeš čemu koje dugme treba da služi?
 
Odgovor na temu

Vinona

Član broj: 160794
Poruke: 16
*.bredband.comhem.se.



Profil

icon Re: Problem sa Collections Array List16.04.2008. u 23:17 - pre 194 meseci


Imam text box za ubacivanje imena i broja testa.Imam list box koja pokazuje konacnu listu testa. 4 buttons koja imaju sledecu akciju. 1.Turn in a test.

2.Let student look at a test. 3 return a test. 4 Exit. Prvo ubacim ime i broj testa. Ubacim test u collection nazvanom submitted tests.

2. Unesem ime , izbrisem test ix submitted tests i ubacim test u collection pod nazivom outForChecking. Pod 3 unesem ime izbrisem test iz outFromChecking i vratim nazad u submitted tests.
pod 4 je Exit. Ja sam to malo gore izmenila u kodu da mi bude lakse a i moj prevod mozda nije bas najbolji.
 
Odgovor na temu

Djoks
Djordje Najdanovic
Software Developer
Azalea Maritime

Član broj: 1630
Poruke: 268
85.94.122.*

Sajt: www.azalea-maritime.com


Profil

icon Re: Problem sa Collections Array List19.04.2008. u 22:41 - pre 194 meseci
Vinona, trebaju ti dvije liste? Jedna prikazuje listu studenata koji su predali testove, a druga - listu studenata čiji testovi čekaju provjeru? I ti hoćeš da prebacuješ studente iz jedne liste u drugu? Ali - nije mi jasno ovo oko unošenja imena?
 
Odgovor na temu

Vinona

Član broj: 160794
Poruke: 16
*.bredband.comhem.se.



Profil

icon Re: Problem sa Collections Array List21.04.2008. u 11:12 - pre 194 meseci
uradila sam to sa dve liste. To sa imenima sam ja nesto pokusala.
Izbacila sam ih.
Hvala ti u svakom slucaju.
 
Odgovor na temu

[es] :: .NET :: .NET Desktop razvoj :: Problem sa Collections Array List

[ Pregleda: 2148 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

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