Açıklama:
Windows Forms kullanılarak hazırlanmış basit bir yapılacaklar listesi uygulaması. Görev ekleme ve silme işlemleri yapılabilir. Başlangıç seviyesindekiler için uygundur.
Kodlar:
Program.cs
MainForm.cs
MainForm.Designer.cs
Windows Forms kullanılarak hazırlanmış basit bir yapılacaklar listesi uygulaması. Görev ekleme ve silme işlemleri yapılabilir. Başlangıç seviyesindekiler için uygundur.
Kodlar:
Program.cs
C#:
using System;
using System.Windows.Forms;
namespace TodoApp
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}
MainForm.cs
C#:
using System;
using System.Windows.Forms;
namespace TodoApp
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void btnEkle_Click(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(txtGorev.Text))
{
lstGorevler.Items.Add(txtGorev.Text);
txtGorev.Clear();
}
}
private void btnSil_Click(object sender, EventArgs e)
{
if (lstGorevler.SelectedIndex != -1)
{
lstGorevler.Items.RemoveAt(lstGorevler.SelectedIndex);
}
}
}
}
MainForm.Designer.cs
C#:
namespace TodoApp
{
partial class MainForm
{
private System.ComponentModel.IContainer components = null;
private System.Windows.Forms.TextBox txtGorev;
private System.Windows.Forms.Button btnEkle;
private System.Windows.Forms.Button btnSil;
private System.Windows.Forms.ListBox lstGorevler;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.txtGorev = new System.Windows.Forms.TextBox();
this.btnEkle = new System.Windows.Forms.Button();
this.btnSil = new System.Windows.Forms.Button();
this.lstGorevler = new System.Windows.Forms.ListBox();
this.SuspendLayout();
//
// txtGorev
//
this.txtGorev.Location = new System.Drawing.Point(12, 12);
this.txtGorev.Size = new System.Drawing.Size(200, 20);
//
// btnEkle
//
this.btnEkle.Location = new System.Drawing.Point(220, 10);
this.btnEkle.Size = new System.Drawing.Size(75, 23);
this.btnEkle.Text = "Ekle";
this.btnEkle.Click += new System.EventHandler(this.btnEkle_Click);
//
// btnSil
//
this.btnSil.Location = new System.Drawing.Point(220, 40);
this.btnSil.Size = new System.Drawing.Size(75, 23);
this.btnSil.Text = "Sil";
this.btnSil.Click += new System.EventHandler(this.btnSil_Click);
//
// lstGorevler
//
this.lstGorevler.Location = new System.Drawing.Point(12, 40);
this.lstGorevler.Size = new System.Drawing.Size(200, 150);
//
// MainForm
//
this.ClientSize = new System.Drawing.Size(310, 200);
this.Controls.Add(this.txtGorev);
this.Controls.Add(this.btnEkle);
this.Controls.Add(this.btnSil);
this.Controls.Add(this.lstGorevler);
this.Text =
"Yapılacaklar Listesi";
this.ResumeLayout(false);
this.PerformLayout();
}
}
}