checkbox kullanarak liste öğeleri alın

checkbox kullanarak liste öğeleri alın

7. January 2010

Read this article in your language IT | EN | DE | ES

 

Merhaba arkadaşlar bu örnek projede console application  uygulamasında bir  windows projesi nasıl   calıştırılır onu  görelim

Örnek Proje

Console Application Code

 
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace console_test
{

    public class Form1 : System.Windows.Forms.Form
    {
        private System.Windows.Forms.CheckedListBox chkListPossibleValues;
        private System.Windows.Forms.ListBox lstSelected;
        private System.Windows.Forms.Button btnMove;
        private System.ComponentModel.Container components = null;

        public Form1()
        {
            InitializeComponent();
            this.chkListPossibleValues.Items.Add("Ten");
          
        }

        private void InitializeComponent()
        {
            this.lstSelected = new System.Windows.Forms.ListBox();
            this.btnMove = new System.Windows.Forms.Button();
            this.chkListPossibleValues = new System.Windows.Forms.CheckedListBox();
            this.SuspendLayout();

            this.lstSelected.Location = new System.Drawing.Point(232, 8);
            this.lstSelected.Name = "lstSelected";
            this.lstSelected.Size = new System.Drawing.Size(136, 186);
            this.lstSelected.TabIndex = 1;

            this.btnMove.Location = new System.Drawing.Point(152, 80);
            this.btnMove.Name = "btnMove";
            this.btnMove.TabIndex = 3;
            this.btnMove.Text = "Move";
            this.btnMove.Click += new System.EventHandler(this.btnMove_Click);

            this.chkListPossibleValues.CheckOnClick = true;
            this.chkListPossibleValues.Items.AddRange(new object[] {"One", "Two", "Three",
                  "Four", "Five","Six","Seven", "Eight", "Nine"});
            this.chkListPossibleValues.Location = new System.Drawing.Point(8, 8);
            this.chkListPossibleValues.Name = "chkListPossibleValues";
            this.chkListPossibleValues.Size = new System.Drawing.Size(136, 184);
            this.chkListPossibleValues.TabIndex = 0;

            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(376, 205);
            this.Controls.AddRange(new System.Windows.Forms.Control[] {this.btnMove,
                                  this.lstSelected,  this.chkListPossibleValues});
            this.Name = "Form1";
            this.Text = "List Boxes";
            this.ResumeLayout(false);


 
        }

        static void Main()
        {
            Application.Run(new Form1());
            Console.WriteLine("Form  Devrede Dışı  ");
            Console.ReadLine();
        }

        private void btnMove_Click(object sender, System.EventArgs e)
        {
            if (this.chkListPossibleValues.CheckedItems.Count > 0)
            {
                this.lstSelected.Items.Clear();
                foreach (string item in this.chkListPossibleValues.CheckedItems)
                {
                    this.lstSelected.Items.Add(item.ToString());
                }
                for (int i = 0; i < this.chkListPossibleValues.Items.Count; i++)
                {
                    this.chkListPossibleValues.SetItemChecked(i, false);
                }
            }
        }
    }
}

  Kaynak Web Sitw : Java2s

FacebookDigg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

C# ,

Comments

4/7/2010 12:13:40 AM #
It does seem that everybody is into this kind of stuff lately. Don’t really understand it though, but thanks for trying to explain it. Appreciate you shedding light into this matter. Keep it up
4/11/2010 8:53:55 PM #
In searching for sites related to web hosting and specifically comparison hosting linux plan web, your site came up.
4/18/2010 10:05:41 PM #
Great information, thank you to the article writer. It truly is understandable to me now, the usefulness and significance is overpowering. Thank you once again and good luck!
4/19/2010 8:12:07 PM #
This is such a superb useful resource that you are providing and you provide it away for totally free. I appreciate visiting web sites that recognize the benefit of giving a good quality resource for free of charge.
4/21/2010 11:52:09 AM #
Bani pe net - Learn how to make money online
5/9/2010 9:22:45 AM #
That is interesting, post more frequently!
5/17/2010 12:52:31 AM #
Don’t really understand it though, but thanks for trying to explain it. Appreciate you shedding light into this matter. Keep it up

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Sayfa 0.046875 saniyede yuklendi.