怎么用c#做一个简单的通讯录
展开全部
如果你是要用winfrom的情况下。。首先你要创建数据库,或者是用TXT存储都可以。。然后就是窗体设计和代码了。你的问题太笼统了。还有这种类型的小软件,你去CSDN去找源代码有很多的。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
代码如下,可以根据喜欢的分栏名字修改:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (int y=1980;y<DateTime.Now.Year;y++)
comboBox1.Items.Add (y.ToString()+"年 ");
for (int m = 1; m < 13; m++)
comboBox2.Items.Add(m.ToString() + "月 ");
for (int d = 1; d <32; d++)
comboBox3.Items.Add(d.ToString() + "日 ");
}
private void button1_Click(object sender, EventArgs e)
{
string str = " ";
if (checkBox1.Checked == true)
str = str + "" + checkBox1.Text;
if (checkBox2.Checked == true)
str = str + "" + checkBox2.Text;
if (checkBox3.Checked ==true)
str = str + "" + checkBox3.Text;
if (checkBox4.Checked == true)
str = str + "" + checkBox4.Text;
if (radioButton1.Checked == true)
str = str + " 性别:" + radioButton1.Text;
else
str = str + " 性别:" + radioButton2.Text;
listBox1.Items.Add(str);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
string str = " ";
str = str + textBox1.Text + " ";
str = str + textBox2.Text + " ";
str = str + textBox3 .Text + " ";
listBox1.Items.Add(str);
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (int y=1980;y<DateTime.Now.Year;y++)
comboBox1.Items.Add (y.ToString()+"年 ");
for (int m = 1; m < 13; m++)
comboBox2.Items.Add(m.ToString() + "月 ");
for (int d = 1; d <32; d++)
comboBox3.Items.Add(d.ToString() + "日 ");
}
private void button1_Click(object sender, EventArgs e)
{
string str = " ";
if (checkBox1.Checked == true)
str = str + "" + checkBox1.Text;
if (checkBox2.Checked == true)
str = str + "" + checkBox2.Text;
if (checkBox3.Checked ==true)
str = str + "" + checkBox3.Text;
if (checkBox4.Checked == true)
str = str + "" + checkBox4.Text;
if (radioButton1.Checked == true)
str = str + " 性别:" + radioButton1.Text;
else
str = str + " 性别:" + radioButton2.Text;
listBox1.Items.Add(str);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
string str = " ";
str = str + textBox1.Text + " ";
str = str + textBox2.Text + " ";
str = str + textBox3 .Text + " ";
listBox1.Items.Add(str);
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |