请问状态栏这个控件怎么用啊,我已经托到form里了,可是不会用,不知道怎么写,给我个小例子就行了,平台C#2005

解决方案 »

  1.   

    MSDN上的例子,不过不是拖的,动态生成的,意思应该差不多...自己看下,或者看下MSDN吧,上面讲得也很清楚了..using System;
    using System.Text;
    using System.Windows.Forms;namespace WindowsApplication4
    {
        public class Form1 : Form
        {
            private StatusStrip statusStrip1;
            private ToolStripStatusLabel toolStripStatusLabel1;
        
            public Form1()
            {
                InitializeComponent();
            }
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.Run(new Form1());
            }        private void InitializeComponent()
            {
                statusStrip1 = new System.Windows.Forms.StatusStrip();
                toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
                statusStrip1.SuspendLayout();
                SuspendLayout();
                // 
                // The following code example demonstrates the syntax for setting
                // various StatusStrip properties.
                statusStrip1.Dock = System.Windows.Forms.DockStyle.Top;
                statusStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Visible;
                statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                toolStripStatusLabel1});
                statusStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
                statusStrip1.Location = new System.Drawing.Point(0, 0);
                statusStrip1.Name = "statusStrip1";
                statusStrip1.ShowItemToolTips = true;
                statusStrip1.Size = new System.Drawing.Size(292, 22);
                statusStrip1.SizingGrip = false;
                statusStrip1.Stretch = false;
                statusStrip1.TabIndex = 0;
                statusStrip1.Text = "statusStrip1";
                // 
                // toolStripStatusLabel1
                // 
                toolStripStatusLabel1.Name = "toolStripStatusLabel1";
                toolStripStatusLabel1.Size = new System.Drawing.Size(109, 17);
                toolStripStatusLabel1.Text = "toolStripStatusLabel1";
                // 
                // Form1
                // 
                ClientSize = new System.Drawing.Size(292, 273);
                Controls.Add(statusStrip1);
                Name = "Form1";
                statusStrip1.ResumeLayout(false);
                statusStrip1.PerformLayout();
                ResumeLayout(false);
                PerformLayout();        }
        }
    }
      

  2.   

    msdn里的那个例子我看不懂,帮忙说说怎么用StatusStrip这个状态栏控件
      

  3.   

    估计楼主只是用做简单用途的,那好办
     public Form1()
            {
                InitializeComponent();
                StatusStrip statusStrip1 = new System.Windows.Forms.StatusStrip();
                ToolStripStatusLabel toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
                // 
                // statusStrip1
                // 
                statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                toolStripStatusLabel1});
                statusStrip1.Location = new System.Drawing.Point(0, 244);
                statusStrip1.Name = "statusStrip1";
                statusStrip1.Size = new System.Drawing.Size(292, 22);
                statusStrip1.TabIndex = 2;
                statusStrip1.Text = "statusStrip1";
                statusStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.statusStrip1_ItemClicked);
                // 
                // toolStripStatusLabel1
                // 
                toolStripStatusLabel1.Name = "toolStripStatusLabel1";
                toolStripStatusLabel1.Size = new System.Drawing.Size(131, 17);
                toolStripStatusLabel1.Text = "toolStripStatusLabel1";
                toolStripStatusLabel1.Text = "你要显示的内容";            this.Controls.Add(statusStrip1);
            }----------------------------------------
     toolStripStatusLabel1.Text = "你要显示的内容";