用\SDK\v1.1\GuiDebug\DbgCLR.exe打开你的基窗口的cs文件,在基窗口构造函数中加上断点
再attach to 你的Visual Studio,在Visual Studio中用设计器打开(打不开的)继承窗口,调试。

解决方案 »

  1.   

    public?  Private?  Protected?
      

  2.   

    Put Error Detail Information?
      

  3.   

    是不是没用对可访问性级别,试试protected或public
      

  4.   

    using System;
    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.Windows.Forms;
    using System.Data.OleDb ;
    using System.Data ;namespace GSCultivate.BaseInfo
    {
    /// <summary>
    /// Form5 的摘要说明。
    /// </summary>
    public class Form5 : System.Windows.Forms.Form
    {
    protected System.Data.DataSet dsCourse;
    protected BindingManagerBase myBind ;
    protected System.Windows.Forms.TextBox txtCode;
    protected System.Windows.Forms.Label label1;
    private System.Windows.Forms.Button button1;
    /// <summary>
    /// 必需的设计器变量。
    /// </summary>
    private System.ComponentModel.Container components = null;

    public Form5()
    {
    try
    {
    string strCom = " SELECT * FROM Course_Main " ;
    //创建一个 DataSet对象
    dsCourse = new System.Data.DataSet ( ) ;
    System.Data.SqlClient.SqlDataAdapter  myCommand = new System.Data.SqlClient.SqlDataAdapter ( strCom , LogOnInfo.cn ) ;
    myCommand.Fill ( dsCourse ,"Course_Main" ) ;
    myBind= this.BindingContext[dsCourse, "Course_Main" ] ;

    }
    catch(Exception e)
    {
    MessageBox.Show (  e.ToString ( ) , "错误" ) ;
    }
    //
    // Windows 窗体设计器支持所必需的
    //
    InitializeComponent();

    //
    // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
    // txtCode.DataBindings.Add ("Text",dsCourse,"Course_Main.Item_Code"); } /// <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.txtCode = new System.Windows.Forms.TextBox();
    this.label1 = new System.Windows.Forms.Label();
    this.button1 = new System.Windows.Forms.Button();
    this.SuspendLayout();
    // 
    // txtCode
    // 
    this.txtCode.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
    this.txtCode.Location = new System.Drawing.Point(104, 56);
    this.txtCode.Name = "txtCode";
    this.txtCode.Size = new System.Drawing.Size(128, 23);
    this.txtCode.TabIndex = 17;
    this.txtCode.Text = "";
    // 
    // label1
    // 
    this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
    this.label1.Location = new System.Drawing.Point(40, 56);
    this.label1.Name = "label1";
    this.label1.TabIndex = 16;
    this.label1.Text = "代    码:";
    // 
    // button1
    // 
    this.button1.Location = new System.Drawing.Point(96, 184);
    this.button1.Name = "button1";
    this.button1.TabIndex = 18;
    this.button1.Text = "button1";
    // 
    // Form5
    // 
    this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
    this.ClientSize = new System.Drawing.Size(292, 266);
    this.Controls.Add(this.button1);
    this.Controls.Add(this.txtCode);
    this.Controls.Add(this.label1);
    this.Name = "Form5";
    this.Text = "Form5";
    this.Load += new System.EventHandler(this.Form5_Load);
    this.ResumeLayout(false); }
    #endregion

    public static void ShowForm()
    {

    Form5 w=new Form5();
    w.Show();
    w.Activate(); 
    }
    private void Form5_Load(object sender, System.EventArgs e)
    {

    }
    }
    }
      

  5.   

    我逐句实验了一下,发现只要加上
    txtCode.DataBindings.Add ("Text",dsCourse,"Course_Main.Item_Code");
    绑定这句继承的窗口就显示不了了