Visual C# DateTimePicker İle Burçları Bulan Program - Bilişim Konuları

Visual C# DateTimePicker İle Burçları Bulan Program

Bu örneğimizde Visual C# Form ortamında bir Datetimepicker nesnesi ve bir tane picturebox nesnesi ile kullanıcının seçmiş olduğu tarihe denk gelen burcu bularak o burca ait olan görseli de resim kutusunda gösteren programı yapacağız. Datetimepicker nesnesinin tarihi değiştiği anda gerekli kontroller sağlanarak o tarihe ait olan burç bulunarak textboxa yazdırılıyor ve resimde picturebox nesnesinde gösteriliyor.

Programın Visual C# kodları:

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

        int gun;
        int ay;
        private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {
            ay=Convert.ToInt16(dateTimePicker1.Value.Month);
            gun=Convert.ToInt16(dateTimePicker1.Value.Day);

        //www.bilisimkonulari.com

            if ((ay == 12 & gun >= 12) || (ay == 1 & gun <= 20))
            {
                TxtBurc.Text = "OĞLAK";
                pictureBox1.ImageLocation="oglak.jpg";
            }

            if ((ay == 9 & gun >= 22) || (ay == 10 & gun <= 23))
            {
                TxtBurc.Text = "TERAZİ";
                pictureBox1.ImageLocation = "terazi.jpg";
            }

            if ((ay == 1 & gun >= 21) || (ay == 2 & gun <= 19))
            {
                TxtBurc.Text = "KOVA";
                pictureBox1.ImageLocation = "kova.jpg";
            }

            //www.bilisimkonulari.com

            if ((ay == 2 & gun >= 20) || (ay == 3 & gun <= 20))
            {
                TxtBurc.Text = "BALIK";
                pictureBox1.ImageLocation = "balik.jpg";
            }

            if ((ay == 3 & gun >= 21) || (ay == 4 & gun <= 20))
            {
                TxtBurc.Text = "KOÇ";
                pictureBox1.ImageLocation = "koc.jpg";
            }

            if ((ay == 4 & gun >= 21) || (ay == 5 & gun <= 21))
            {
                TxtBurc.Text = "BOĞA";
                pictureBox1.ImageLocation = "boga.jpg";
            }

            //www.bilisimkonulari.com


            if ((ay == 5 & gun >= 22) || (ay == 6 & gun <= 21))
            {
                TxtBurc.Text = "İKİZLER";
                pictureBox1.ImageLocation = "ikizler.jpg";
            }

            if ((ay == 6 & gun >= 22) || (ay == 7 & gun <= 23))
            {
                TxtBurc.Text = "YENGEÇ";
                pictureBox1.ImageLocation = "yengec.jpg";
            }

            if ((ay == 7 & gun >= 24) || (ay == 8 & gun <= 23))
            {
                TxtBurc.Text = "ASLAN";
                pictureBox1.ImageLocation = "aslan.jpg";
            }

            if ((ay == 8 & gun >= 24) || (ay == 9 & gun <= 23))
            {
                TxtBurc.Text = "BAŞAK";
                pictureBox1.ImageLocation = "basak.jpg";
            }

            //www.bilisimkonulari.com

            if ((ay == 102 & gun >= 23) || (ay == 11 & gun <= 22))
            {
                TxtBurc.Text = "AKREP";
                pictureBox1.ImageLocation = "akrep.jpg";
            }

            if ((ay == 11 & gun >= 23) || (ay == 12 & gun <= 22))
            {
                TxtBurc.Text = "YAY";
                pictureBox1.ImageLocation = "yay.jpg";
            }
            
    
        }
    }
}

Programın ekran görüntüleri:

terazi-burcuaslan-burcuyay-burcuikizler-burcu

Bu Yazıya Tepkin Nedir?
+1
3
+1
0
+1
0
+1
0
+1
0
+1
0
+1
1

Yorum Yap