在Form2.cs[设计]中已经设计好窗体。
在Form2.cs中代码如下: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 Form2 : Form
{
public Form2()
{
InitializeComponent();
} private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{ } private void button1_Click(object sender, EventArgs e)
{
listBox_Book.Items.Add("书名:" + textBox_Bookname.Text + ",出版社:" + comboBox_Publishing.Text);
textBox_Bookname.Text = ""; } private void button2_Click(object sender, EventArgs e)
{
if (listBox_Book.SelectedIndex != -1)
{
listBox_Book.Items.Remove(this.listBox_Book.SelectedItem);
} } private void textBox_Bookname_TextChanged(object sender, EventArgs e)
{ } private void comboBox_Publishing_SelectedIndexChanged(object sender, EventArgs e)
{ }
}
}
为什么F5运行后出现的却是空白的窗体?就是新建Windows项目初始化的那种窗体。
在Form2.cs中代码如下: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 Form2 : Form
{
public Form2()
{
InitializeComponent();
} private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{ } private void button1_Click(object sender, EventArgs e)
{
listBox_Book.Items.Add("书名:" + textBox_Bookname.Text + ",出版社:" + comboBox_Publishing.Text);
textBox_Bookname.Text = ""; } private void button2_Click(object sender, EventArgs e)
{
if (listBox_Book.SelectedIndex != -1)
{
listBox_Book.Items.Remove(this.listBox_Book.SelectedItem);
} } private void textBox_Bookname_TextChanged(object sender, EventArgs e)
{ } private void comboBox_Publishing_SelectedIndexChanged(object sender, EventArgs e)
{ }
}
}
为什么F5运行后出现的却是空白的窗体?就是新建Windows项目初始化的那种窗体。
解决方案 »
- 局域网共享txt文本,如何避免调用时出现"正在使用中"!!
- c# 如何实现SFTP文件上传
- C#如何导入printDocument?
- 如何快速从listview中导出数据到excel中!我的60000条数据需要大约25分钟,太夸张了!!!!
- VS2005,一打开别的程序就自动关闭,有遇到过的朋友吗?
- 戏弄c#
- WCF传输一个视频流
- 超大窗体如何实现?从size设置,最大的治愈3306,1100,能更大不?用在监控中心大屏上的。
- 如何对依此输入的4个数字进行比较(使用Console.ReadLine),求出最大直和最小值
- 如何让wpf+水晶报表 打印之后让datagrid的数据变色
- 垃圾回收与终结
- JS页面跳转
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}