using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
namespace 音乐世界
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class frmCategory : System.Windows.Forms.Form
{
private System.Windows.Forms.Label lblCategory;
private System.Windows.Forms.ComboBox cboCategory;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public frmCategory()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.lblCategory = new System.Windows.Forms.Label();
this.cboCategory = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// lblCategory
//
this.lblCategory.Location = new System.Drawing.Point(32, 40);
this.lblCategory.Name = "lblCategory";
this.lblCategory.Size = new System.Drawing.Size(64, 24);
this.lblCategory.TabIndex = 0;
this.lblCategory.Text = "注册";
//
// cboCategory
//
this.cboCategory.Location = new System.Drawing.Point(88, 40);
this.cboCategory.Name = "cboCategory";
this.cboCategory.Size = new System.Drawing.Size(152, 20);
this.cboCategory.TabIndex = 1;
this.cboCategory.SelectedIndexChanged += new System.EventHandler(this.cboCategory_SelectedIndexChanged);
//
// frmCategory
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(344, 166);
this.Controls.Add(this.cboCategory);
this.Controls.Add(this.lblCategory);
this.Name = "frmCategory";
this.Text = "欢迎来到音乐世界";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new frmCategory());
}
private void Form1_Load(object sender, System.EventArgs e)
{
cboCategory.Items.Add("电影");
cboCategory.Items.Add("歌曲");
}
private void cboCategory_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(cboCategory.SelectedItem.Equals("电影"))
objfrmMovie.ShowDialog();
else
objfrmSong.ShowDialog();
}
}
}
错误提示:
e:\net 作业\音乐世界\frmcategory.cs(109,4): error CS0246: 找不到类型或命名空间名称“objfrmMovie”(是否缺少 using 指令或程序集引用?)
e:\net 作业\音乐世界\frmcategory.cs(111,5): error CS0246: 找不到类型或命名空间名称“objfrmSong”(是否缺少 using 指令或程序集引用?)