Add and Clear Items in a ListBox Control

Posted by

Latihan pertama yang menyenangkan dengan futuristik dari C# 2008 punyaknya Microsoft in yang semakin hari semakin cantik aja.. dan yang pasti hebat bgt brow.., langsung aja

Buatlah sebuah project baru dari Microsoft Visual C# 2008 ato yang lebih tinggi boleh..
buatlah tampilan seperti dibawah ini :

Berikut Sample Codingnya :

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)
        {
            this.listBox1.Items.Add(this.textBox1.Text);
            this.textBox1.Text = "";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.listBox1.Items.Clear();
        }
      
    }
}


FOLLOW and JOIN to Get Update!

Social Media Widget SM Widgets




Demo Blog NJW V2 Updated at: 1:50 AM

0 komentar: