第二章例题:TwoStatusBarPanels

对应教材2.2.2中的(2)部分

None.gif using  System;
None.gif
using  System.Drawing;
None.gif
using  System.Windows.Forms;
None.gif
None.gif
None.gif
public   class  TwoStatusBarPanels:Form
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    
public static void Main()
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        Application.Run(
new TwoStatusBarPanels());
ExpandedSubBlockEnd.gif    }

InBlock.gif    
public TwoStatusBarPanels()
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
//设置窗体属性,这些属性属于基类Form
InBlock.gif
        Text = "Two Status Bar Panels";
InBlock.gif        BackColor 
= SystemColors.Window;
InBlock.gif        ForeColor 
= SystemColors.WindowText;
InBlock.gif
InBlock.gif        
//动态创建StstusBar控件
InBlock.gif
        StatusBar sb = new StatusBar();
InBlock.gif        sb.Parent 
= this;
InBlock.gif        sb.ShowPanels 
= true;
InBlock.gif
InBlock.gif        
//动态创建StatusBarPanel控件
InBlock.gif
        StatusBarPanel sbPanel1 = new StatusBarPanel();
InBlock.gif        sbPanel1.Text 
= "Panel 1";
InBlock.gif
InBlock.gif        StatusBarPanel sbPanel2 
= new StatusBarPanel();
InBlock.gif        sbPanel2.Text 
= "Panel 2";
InBlock.gif        
InBlock.gif        
//将StatusBarPanel控件实例添加到StstusBar控件的Panels集合
InBlock.gif
        sb.Panels.Add(sbPanel1);
InBlock.gif        sb.Panels.Add(sbPanel2);
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}
完整源代码下载: TwoStatusBarPanels.rar

转载于:https://www.cnblogs.com/hhdn/archive/2007/03/01/660625.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值