For Döngüsü

For Döngüsü 

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

        private void button1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 700; i++)
            {
                pictureBox1.Left += 1;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 700; i++)
            {
                pictureBox2.Left += 1;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 700; i++)
            {
                pictureBox1.Left+=5;
                pictureBox1.Left -= 2;
                pictureBox1.Left -= 2;
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 700; i++)
            {
                pictureBox2.Left += 1;
            }
        }

        private void button5_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 700; i++)
            {
                pictureBox1.Left -= 1;
            }
        }

        private void button6_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 700; i++)
            {
                pictureBox2.Left -= 1;
            }
        }
    }
}

 

For Döngüsüusing System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;

namespace GrafikÇizme
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public void ahmet()
        {
            chart1.Series.Clear();
            int x;
            for (int i = 0; i < 13; i++)
            {
                x = i + 1;

                Series series = this.chart1.Series.Add(x.ToString());
                series.Points.Add(i);
            }

        }

        private void chart1_Click(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            ahmet();
        }
    }
}

 

For Döngüsü

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SayıYazdırma
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {


           
            int ahmet1 = Convert.ToInt32(textBox1.Text);
            int ahmet2 = 0;
            for (int i = 0; i < ahmet1; i++)
            {
                richTextBox1.Text = richTextBox1.Text + ahmet2.ToString() + ",";
                ahmet2++;

                if (ahmet2 == ahmet1)
                {
                    richTextBox1.Text = richTextBox1.Text + Convert.ToString(ahmet1);
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            richTextBox1.Clear();
        }
    }
}

 

Break Kullanımı

For Döngüsü

For DöngüsüFor Döngüsü

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MesajDöngüsü
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int ahmet = Convert.ToInt32(textBox2.Text);
            string isim = textBox1.Text;
            int b = 0;
            do
            {
                DialogResult result1 = MessageBox.Show(isim, "İsim girdisi", MessageBoxButtons.OKCancel);
                if (result1 == DialogResult.Cancel)
                {
                    MessageBox.Show("Uygulama durduruldu", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    break;
                }
                b++;

            } while (b < ahmet);
        }
    }
}

   

 

Yorumunuzu Ekleyin


Yükleniyor...
Yükleniyor...