برای مشاهده مفیدترین ارسال در این موضوع اینجا کلیک کنید

نمایش نتایج: از شماره 1 تا 1 از مجموع 1
  1. #1
    مدیر بازنشسته
    تاریخ عضویت
    2011 June
    محل سکونت
    گرگان
    ارسال ها
    1,170
    تشکر
    62
    تشکر شده 1,587 بار در 809 پست
    نوشته های وبلاگ
    49


    3 امتياز مثبت از 3 راي
    آيا اين پست براي شما سودمند بود؟ بله | خیر

    کلیپ آماده از ساختمان داده با زبان #c

    سلام
    خداروشکر که بعد از یک ساعتو خورده ای بالاخره آپلود شد!!!!
    موفق باشید..

    این فرم اصلیه:
    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 ppppp
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }
    /////////////////////////////////////////////////////////////////////////////////////


    private void Form1_Load(object sender, EventArgs e)
    {
    timer1.Enabled = true;//faal kardane timere saat
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer1_Tick(object sender, EventArgs e)
    {
    label1.Text = DateTime.Now.ToLongTimeString();//baraye saat
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button1_Click(object sender, EventArgs e)
    {
    Form ff = new Form3();//form poshte new mishe
    ff.Show();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button2_Click(object sender, EventArgs e)
    {
    Form ff = new Form4();
    ff.Show();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button3_Click(object sender, EventArgs e)
    {
    Form ff = new Form2();
    ff.Show();
    }

    /////////////////////////////////////////////////////////////////////////////////////


    private void button4_Click(object sender, EventArgs e)
    {
    Form ff = new Form9();
    ff.Show();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button5_Click(object sender, EventArgs e)
    {
    if (MessageBox.Show("آیامطمئن هستید؟", "خروج", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
    this.Close();
    }
    }
    }




    این فرمای بعدیشه :

    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 ppppp
    {
    public partial class Form3 : Form
    {
    public Form3()
    {
    InitializeComponent();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button1_Click(object sender, EventArgs e)
    {
    Form ff = new Form7();
    ff.Show();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button2_Click(object sender, EventArgs e)
    {
    Form ff = new Form8();
    ff.Show();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button3_Click(object sender, EventArgs e)
    {
    Form ff = new Form12();
    ff.Show();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button4_Click(object sender, EventArgs e)
    {
    Form ff = new Form10();
    ff.Show();
    }



    }
    }




    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 ppppp
    {
    public partial class Form4 : Form
    {
    public Form4()
    {
    InitializeComponent();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button1_Click(object sender, EventArgs e)
    {
    Form ff = new Form5();
    ff.Show();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button2_Click(object sender, EventArgs e)
    {
    Form ff = new Form6();
    ff.Show();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button3_Click(object sender, EventArgs e)
    {
    Form ff = new Form13();
    ff.Show();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button4_Click(object sender, EventArgs e)
    {
    Form ff = new Form11();
    ff.Show();
    }

    }
    }




    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;
    using System.Threading;


    namespace ppppp
    {
    public partial class Form5 : Form
    {
    public Form5()
    {
    InitializeComponent();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    Bitmap b = new Bitmap(1020, 700);//ye chi me3 graphic(andaze slid)
    Graphics g1;
    Graphics g2;
    int i = 17;//shomare shoroe aks saff
    bool k = true;


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form5_Load(object sender, EventArgs e)
    {
    g1 = Graphics.FromImage(b);
    g2 = Graphics.FromHwnd(this.Handle);
    Thread.Sleep(1);//load form amozesh saff
    timer1.Start();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer1_Tick(object sender, EventArgs e)
    {
    g1.DrawImage(Image.FromFile("(" + i + ").jpg"), 0, 0, 1020, 700);//imageha ro poshte ham miare
    if (k)
    i++;
    Thread.Sleep(3000);//vaqfe beine slideha
    g2.DrawImage(b,0,0);//noqte shoro eslide


    if (i >= 26)
    k = false;
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form5_Shown(object sender, EventArgs e)//baz shodan form_event - shown
    {
    this.Size = new System.Drawing.Size(0,0);//noghte shorue form
    for (int i = 0; i < 1000; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width + 1, this.Size.Height + 1);//yki yki ziad mishe


    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form5_FormClosing(object sender, FormClosingEventArgs e)
    {
    this.Size = new System.Drawing.Size(1020, 700);//noghteye entehaye form


    for (int i = 0; i < 1000; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width - 1, this.Size.Height - 1); //yki yki kam mishe


    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button1_Click(object sender, EventArgs e)
    {
    this.Close();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button2_Click(object sender, EventArgs e)
    {
    this.Close();
    }
    }
    }




    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;
    using System.Threading;


    namespace ppppp
    {
    public partial class Form6 : Form
    {
    public Form6()
    {
    InitializeComponent();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    Bitmap b = new Bitmap(1020, 700);
    Graphics g1;
    Graphics g2;
    int i = 27;
    bool k = true;


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form6_Load(object sender, EventArgs e)
    {
    g1 = Graphics.FromImage(b);
    g2 = Graphics.FromHwnd(this.Handle);
    Thread.Sleep(3000);
    timer1.Start();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer1_Tick(object sender, EventArgs e)
    {
    g1.DrawImage(Image.FromFile("(" + i + ").jpg"), 0, 0, 1020, 700);
    if (k)
    i++;
    Thread.Sleep(3000);
    g2.DrawImage(b, 0, 0);
    if (i >= 32)
    {
    k = false;
    }
    if (i == 1)
    {
    k = true;
    Thread.Sleep(1000);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form6_Shown(object sender, EventArgs e)
    {
    this.Size = new System.Drawing.Size(0, 0);
    for (int i = 0; i < 1000; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width + 1, this.Size.Height + 1);


    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form6_FormClosing(object sender, FormClosingEventArgs e)
    {
    this.Size = new System.Drawing.Size(1020, 700);


    for (int i = 0; i < 1000; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width - 1, this.Size.Height - 1);


    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button1_Click(object sender, EventArgs e)
    {
    this.Close();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button2_Click(object sender, EventArgs e)
    {
    this.Close();
    }
    }
    }





    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;
    using System.Threading;


    namespace ppppp
    {
    public partial class Form7 : Form
    {
    public Form7()
    {
    InitializeComponent();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    Bitmap b = new Bitmap(1020, 700);
    Graphics g1;
    Graphics g2;
    int i = 1;
    bool k = true;


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form7_Load(object sender, EventArgs e)
    {
    g1 = Graphics.FromImage(b);
    g2 = Graphics.FromHwnd(this.Handle);
    Thread.Sleep(3000);
    timer1.Start();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer1_Tick(object sender, EventArgs e)
    {
    g1.DrawImage(Image.FromFile("(" + i + ").jpg"), 0, 0, 1020, 700);
    if (k)
    i++;
    Thread.Sleep(3000);
    g2.DrawImage(b, 0, 0);
    if (i >= 10)
    {
    k = false;
    }
    if (i == 1)
    {
    k = true;
    Thread.Sleep(1000);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form7_Shown(object sender, EventArgs e)
    {
    this.Size = new System.Drawing.Size(0, 0);
    for (int i = 0; i < 1020; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width + 1, this.Size.Height + 1);


    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form7_FormClosing(object sender, FormClosingEventArgs e)
    {
    this.Size = new System.Drawing.Size(1020, 700);


    for (int i = 0; i < 1000; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width - 1, this.Size.Height - 1);


    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button1_Click(object sender, EventArgs e)
    {
    this.Close();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button2_Click(object sender, EventArgs e)
    {
    this.Close();
    }
    }
    }





    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;
    using System.Threading;


    namespace ppppp
    {
    public partial class Form8 : Form
    {
    public Form8()
    {
    InitializeComponent();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    Bitmap b = new Bitmap(1020, 700);
    Graphics g1;
    Graphics g2;
    int i = 11;
    bool k = true;


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form8_Load(object sender, EventArgs e)
    {
    g1 = Graphics.FromImage(b);
    g2 = Graphics.FromHwnd(this.Handle);
    Thread.Sleep(3000);
    timer1.Start();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer1_Tick(object sender, EventArgs e)
    {
    g1.DrawImage(Image.FromFile("(" + i + ").jpg"), 0, 0, 1020, 700);
    if (k)
    i++;
    Thread.Sleep(3000);
    g2.DrawImage(b, 0, 0);
    if (i >= 16)
    {
    k = false;
    }
    if (i == 1)
    {
    k = true;
    Thread.Sleep(1000);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form8_Shown(object sender, EventArgs e)
    {
    this.Size = new System.Drawing.Size(0, 0);
    for (int i = 0; i < 1000; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width + 1, this.Size.Height + 1);


    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form8_FormClosing(object sender, FormClosingEventArgs e)
    {
    this.Size = new System.Drawing.Size(1020, 700);


    for (int i = 0; i < 1000; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width - 1, this.Size.Height - 1);


    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button1_Click(object sender, EventArgs e)
    {
    this.Close();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button2_Click(object sender, EventArgs e)
    {
    this.Close();
    }
    }
    }





    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;
    using System.Media;


    namespace ppppp
    {
    public partial class Form9 : Form
    {
    public Form9()
    {
    InitializeComponent();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void radioButton2_CheckedChanged(object sender, EventArgs e)
    {
    SoundPlayer c = new SoundPlayer("music1.wav");
    c.Stop();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void radioButton3_CheckedChanged(object sender, EventArgs e)
    {
    SoundPlayer c = new SoundPlayer("music1.wav");
    c.Play();
    }
    }
    }





    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 ppppp
    {
    public partial class Form10 : Form
    {
    public Form10()
    {
    InitializeComponent();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
    {
    if (treeView1.SelectedNode.Text == "Push نمایش تابع")

    MessageBox.Show("public void push(object Data)\n{\n if(IsFull())\n throw new exception();\n item[++top]=Data;\n}", "push");





    if (treeView1.SelectedNode.Text == "Pop نمایش تابع")

    MessageBox.Show("public object pop()\n{\n if(IsEmpty())\n throw new exception();\n return(item[top--]);\n}", "pop");






    if (treeView1.SelectedNode.Text == "TestTop نمایش تابع")


    MessageBox.Show("public object TestTop()\n{\n if(IsEmpty())\n throw new exception();\n return(item[top]);\n}", "TestTop");






    if (treeView1.SelectedNode.Text == "IsEmpty نمایش تابع")


    MessageBox.Show("public bool IsEmpty()\n{\n return(top==-1);\n}", "IsEmpty");






    if (treeView1.SelectedNode.Text == "IsFull نمایش تابع")


    MessageBox.Show("public bool IsFull()\n{\n if(top==size-1)\n return true;\n else\n return false;\n}", "IsFull");


    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form10_Shown(object sender, EventArgs e)
    {
    this.Size = new System.Drawing.Size(0, 0);
    for (int i = 0; i < 900; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width + 1, this.Size.Height + 1);


    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form10_FormClosing(object sender, FormClosingEventArgs e)
    {
    this.Size = new System.Drawing.Size(1048,721);
    for (int i = 0; i < 900; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width - 1, this.Size.Height - 1);


    }
    }
    }
    }





    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 ppppp
    {
    public partial class Form11 : Form
    {
    public Form11()
    {
    InitializeComponent();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
    {


    if (treeView1.SelectedNode.Text == "Insert نمایش تابع")


    MessageBox.Show("public void Insert(object Data)\n{\n if(IsFull())\n throw new exception();\n item[++rear]=Data;\n}", "Insert");






    if (treeView1.SelectedNode.Text == "Remove نمایش تابع")


    MessageBox.Show("public object Remove()\n{\n if(IsEmpty())\n throw new exception();\n return(item[++front]);\n}", "Remove");






    if (treeView1.SelectedNode.Text == "QueueLen نمایش تابع")


    MessageBox.Show("public int QueueLen()\n{\n return(rear-front);\n}", "QueueLen");






    if (treeView1.SelectedNode.Text == "IsEmpty نمایش تابع")


    MessageBox.Show("public bool IsEmpty()\n{\n return(front==rear);\n}", "IsEmpty");






    if (treeView1.SelectedNode.Text == "IsFull نمایش تابعع")


    MessageBox.Show("public bool IsFull()\n{ return(rear==size-1);\n}", "IsFull");

    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form11_Shown(object sender, EventArgs e)
    {
    this.Size = new System.Drawing.Size(0, 0);
    for (int i = 0; i < 900; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width + 1, this.Size.Height + 1);


    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void Form11_FormClosing(object sender, FormClosingEventArgs e)
    {
    this.Size = new System.Drawing.Size(1048,721);
    for (int i = 0; i < 900; i++)
    {
    this.Size = new System.Drawing.Size(this.Size.Width - 1, this.Size.Height - 1);


    }
    }
    }
    }





    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;
    using System.Threading;


    namespace ppppp
    {
    public partial class Form12 : Form
    {
    public Form12()
    {
    InitializeComponent();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    poshteh p = new poshteh();
    Button [] btn = new Button[5];
    static int help = -1;
    static int top = -1;


    /////////////////////////////////////////////////////////////////////////////////////


    private void button1_Click(object sender, EventArgs e)
    {
    help++;
    top++;


    btn[0] = button5;
    btn[1] = button6;
    btn[2] = button7;
    btn[3] = button8;
    btn[4] = button9;


    btn[help].Text = textBox1.Text;
    textBox1.Text = "";




    if (help == 0)
    timer1.Enabled = true;

    if (help == 1)
    timer2.Enabled = true;


    if (help == 2)
    timer3.Enabled = true;


    if (help == 3)
    timer4.Enabled = true;


    if (help == 4)
    timer5.Enabled = true;

    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer1_Tick(object sender, EventArgs e)
    {


    while (btn[0].Left <= panel1.Left)
    {
    p.push(textBox1.Text);
    btn[0].Left += 1;
    Thread.Sleep(3);
    timer1.Enabled = false;
    label3.Text =Convert.ToString(help);
    }


    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer2_Tick(object sender, EventArgs e)
    {
    while (btn[1].Left <= panel1.Left)
    {
    p.push(textBox1.Text);
    btn[1].Left += 1;
    Thread.Sleep(3);
    timer2.Enabled = false;
    label3.Text = Convert.ToString(help);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer3_Tick(object sender, EventArgs e)
    {
    while (btn[2].Left <= panel1.Left)
    {
    p.push(textBox1.Text);
    btn[2].Left += 1;
    Thread.Sleep(3);
    timer3.Enabled = false;
    label3.Text = Convert.ToString(help);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer4_Tick(object sender, EventArgs e)
    {
    while (btn[3].Left <= panel1.Left)
    {
    p.push(textBox1.Text);
    btn[3].Left += 1;
    Thread.Sleep(3);
    timer4.Enabled = false;
    label3.Text = Convert.ToString(help);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer5_Tick(object sender, EventArgs e)
    {
    while (btn[4].Left <= panel1.Left)
    {
    p.push(textBox1.Text);
    btn[4].Left += 1;
    Thread.Sleep(3);
    timer5.Enabled = false;
    label3.Text = Convert.ToString(help);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button2_Click(object sender, EventArgs e)
    {
    top--;


    btn[0] = button5;
    btn[1] = button6;
    btn[2] = button7;
    btn[3] = button8;
    btn[4] = button9;




    if (help==0)
    timer6.Enabled = true;


    if (help == 1)
    timer7.Enabled = true;


    if (help == 2)
    timer7.Enabled = true;


    if (help == 3)
    timer8.Enabled = true;


    if (help == 4)
    timer9.Enabled = true;


    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer6_Tick(object sender, EventArgs e)
    {
    while (btn[help].Left >= panel2.Right)
    {
    p.pop();
    btn[help].Left -= 1;
    Thread.Sleep(3);
    timer6.Enabled = false;
    label3.Text = Convert.ToString(help-1);
    }
    help--;
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer7_Tick(object sender, EventArgs e)
    {
    while (btn[help].Left >= panel2.Right)
    {
    p.pop();
    btn[help].Left -= 1;
    Thread.Sleep(3);
    timer7.Enabled = false;
    label3.Text = Convert.ToString(help-1);
    }
    help--;
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer8_Tick(object sender, EventArgs e)
    {
    while (btn[help].Left >= panel2.Right)
    {
    p.pop();
    btn[help].Left -= 1;
    Thread.Sleep(3);
    timer8.Enabled = false;
    label3.Text = Convert.ToString(help-1);
    }
    help--;
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer9_Tick(object sender, EventArgs e)
    {
    while (btn[help].Left >= panel2.Right)
    {
    p.pop();
    btn[help].Left -= 1;
    Thread.Sleep(3);
    timer9.Enabled = false;
    label3.Text = Convert.ToString(help-1);
    }
    help--;
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer10_Tick(object sender, EventArgs e)
    {
    while (btn[help].Left >= panel2.Right)
    {
    p.pop();
    btn[help].Left -= 1;
    Thread.Sleep(3);
    timer10.Enabled = false;
    label3.Text = Convert.ToString(help-1);
    }
    help--;
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button3_Click(object sender, EventArgs e)
    {
    if (top == -1)
    {
    p.IsEmpty();
    MessageBox.Show("پشته خالی است");
    }
    else
    MessageBox.Show("پشته خالی نیست");


    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button4_Click(object sender, EventArgs e)
    {
    if (top == 4)
    {
    p.IsFull();
    MessageBox.Show("پشته پر است");
    }
    else
    MessageBox.Show("پشته پر نشده است");


    }

    }
    }





    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;
    using System.Threading;


    namespace ppppp
    {
    public partial class Form13 : Form
    {
    public Form13()
    {
    InitializeComponent();
    }


    /////////////////////////////////////////////////////////////////////////////////////


    Button[] btn = new Button[5];
    int front = -1;
    int rear = -1;
    saf s = new saf();


    /////////////////////////////////////////////////////////////////////////////////////


    private void button1_Click(object sender, EventArgs e)
    {
    rear++;


    btn[0] = button5;
    btn[1] = button6;
    btn[2] = button7;
    btn[3] = button8;
    btn[4] = button9;


    btn[rear].Text = textBox1.Text;
    textBox1.Text = "";


    if (rear == 0)
    timer1.Enabled = true;


    if (rear == 1)
    timer2.Enabled = true;


    if (rear == 2)
    timer3.Enabled = true;


    if (rear == 3)
    timer4.Enabled = true;


    if (rear == 4)
    timer5.Enabled = true;


    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer1_Tick(object sender, EventArgs e)
    {
    while (btn[0].Top <= panel1.Top)
    {
    s.Insert(textBox1.Text);
    btn[0].Top += 1;
    Thread.Sleep(3);
    timer1.Enabled = false;
    label5.Text = Convert.ToString(rear);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer2_Tick(object sender, EventArgs e)
    {
    while (btn[1].Top <= panel1.Top)
    {
    btn[1].Top += 1;
    Thread.Sleep(3);
    timer2.Enabled = false;
    label5.Text = Convert.ToString(rear);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer3_Tick(object sender, EventArgs e)
    {
    while (btn[2].Top <= panel1.Top)
    {
    btn[2].Top += 1;
    Thread.Sleep(3);
    timer3.Enabled = false;
    label5.Text = Convert.ToString(rear);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer4_Tick(object sender, EventArgs e)
    {
    while (btn[3].Top <= panel1.Top)
    {
    btn[3].Top += 1;
    Thread.Sleep(3);
    timer4.Enabled = false;
    label5.Text = Convert.ToString(rear);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer5_Tick(object sender, EventArgs e)
    {
    while (btn[4].Top <= panel1.Top)
    {
    btn[4].Top += 1;
    Thread.Sleep(3);
    timer5.Enabled = false;
    label5.Text = Convert.ToString(rear);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button2_Click(object sender, EventArgs e)
    {
    front++;


    btn[0] = button5;
    btn[1] = button6;
    btn[2] = button7;
    btn[3] = button8;
    btn[4] = button9;


    if (front == 0)
    timer6.Enabled = true;


    if (front == 1)
    timer7.Enabled = true;


    if (front == 2)
    timer7.Enabled = true;


    if (front == 3)
    timer8.Enabled = true;


    if (front == 4)
    timer9.Enabled = true;
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer6_Tick(object sender, EventArgs e)
    {
    while (btn[front].Top >= panel2.Top+13)
    {
    s.Remove();
    btn[front].Top -= 1;
    Thread.Sleep(3);
    timer6.Enabled = false;
    label3.Text = Convert.ToString(front);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer7_Tick(object sender, EventArgs e)
    {
    while (btn[front].Top >= panel2.Top + 13)
    {
    s.Remove();
    btn[front].Top -= 1;
    Thread.Sleep(3);
    timer7.Enabled = false;
    label3.Text = Convert.ToString(front);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void timer8_Tick(object sender, EventArgs e)
    {
    while (btn[front].Top >= panel2.Top + 13)
    {
    s.Remove();
    btn[front].Top -= 1;
    Thread.Sleep(3);
    timer8.Enabled = false;
    label3.Text = Convert.ToString(front);
    }
    }
    /////////////////////////////////////////////////////////////////////////////////////


    private void timer9_Tick(object sender, EventArgs e)
    {
    while (btn[front].Top >= panel2.Top + 13)
    {
    s.Remove();
    btn[front].Top -= 1;
    Thread.Sleep(3);
    timer9.Enabled = false;
    label3.Text = Convert.ToString(front);
    }
    }
    /////////////////////////////////////////////////////////////////////////////////////


    private void timer10_Tick(object sender, EventArgs e)
    {
    while (btn[front].Top >= panel2.Top + 13)
    {
    s.Remove();
    btn[front].Top -= 1;
    Thread.Sleep(3);
    timer10.Enabled = false;
    label3.Text = Convert.ToString(front);
    }
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button3_Click(object sender, EventArgs e)
    {
    if (front == rear)
    {
    s.IsEmpty();
    MessageBox.Show("صف خالی است");
    }
    else
    MessageBox.Show("صف خالی نیست");
    }


    /////////////////////////////////////////////////////////////////////////////////////


    private void button4_Click(object sender, EventArgs e)
    {
    if (rear == 4)
    {
    s.IsFull();
    MessageBox.Show("صف پراست");
    }
    else
    MessageBox.Show("صف پر نیست");
    }

    }
    }





    فرم مربوط به پشته:

    using System;using System.Collections.Generic;
    using System.Linq;
    using System.Text;


    namespace ppppp
    {
    class poshteh
    {
    public int size = 100, count = 0;
    private string[] item;
    private int top;


    public poshteh()
    {
    item = new string [size];
    top = -1;
    }


    //////////////////////////////////////////////////////////////////////
    public bool IsFull()
    {
    if (top == size - 1)
    return true;
    else
    return false;
    }
    //////////////////////////////////////////////////////////////////////
    public bool IsEmpty()
    {
    if (top == -1)
    return true;
    else
    return false;
    }
    //////////////////////////////////////////////////////////////////////
    public bool push(object data)
    {
    if (IsFull())
    return false;


    item[++top] = (string)data;
    count++;
    return true;
    }
    //////////////////////////////////////////////////////////////////////
    public object pop()
    {
    if (IsEmpty())
    return '-';
    count--;
    return (item[top--]);


    }


    ////////////////////////////////////////////////////////////////////
    public string toptest()
    {
    if (IsEmpty())
    return "z";
    return (item[top]);
    }


    }
    }





    فرم مربوط به صف:

    using System;using System.Collections.Generic;
    using System.Linq;
    using System.Text;


    namespace ppppp
    {
    class saf
    {
    private object[] item;
    private int front, rear;
    private int size = 1000;
    public saf()
    {
    item = new object[size];
    front = rear = -1;
    }
    //*****************************************************
    public int IsEmpty()
    {
    return (front = rear);
    }
    //*****************************************************
    public bool IsFull()
    {
    return (rear == size - 1);
    }
    //*****************************************************
    public void Insert(string data)
    {
    item[++rear] = data;
    }
    //*****************************************************
    public object Remove()
    {
    return(item[++front]);
    }


    }
    }




    موضوعات مشابه:
    فایل های پیوست شده
    • نوع فایل: zip ppppp.zip (88.15 مگابایت ,  این فایل 23 بار دانلود شده است)
    ویرایش توسط NIIT : 12th July 2012 در ساعت 02:55 PM
    آرامش محصول تفکر نیست! آرامش هنر نیندیشیدن به انبوه مسائلیست که ارزش فکر کردن ندارد...

 

 

کاربران برچسب خورده در این موضوع

علاقه مندی ها (Bookmarks)

علاقه مندی ها (Bookmarks)

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •  


Powered by vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0
Persian Language By Ustmb.ir
این انجمن کاملا مستقل بوده و هیچ ارتباطی با دانشگاه علوم و فنون مازندران و مسئولان آن ندارد..این انجمن و تمامی محتوای تولید شده در آن توسط دانشجویان فعلی و فارغ التحصیل ادوار گذشته این دانشگاه برای استفاده دانشجویان جدید این دانشگاه و جامعه دانشگاهی کشور فراهم شده است.لطفا برای اطلاعات بیشتر در رابطه با ماهیت انجمن با مدیریت انجمن ارتباط برقرار کنید
ساعت 04:09 PM بر حسب GMT +4 می باشد.