OutLookBar控件的使用

一: OutLookBar 的使用

1 :从网上下载 UtilityLibrary.dll ,并在工程引用中添加该 DLL 。
2 :添加 SplitContainer 控件 .
3 :添加 ImageList 控件。
4 :申明类
private UtilityLibrary.WinControls.OutlookBar outLookBar = null;
private UtilityLibrary.WinControls.OutlookBarBand LinklookBarBand = null;

二:添加函数,在程序启动过程中调用

private void InitializeOutLookBar()
{
    this.outLookBar = new UtilityLibrary.WinControls.OutlookBar();

    this.LinklookBarBand = new UtilityLibrary.WinControls.OutlookBarBand(" 链路管理");
    this.LinklookBarBand.SmallImageList = igl_link;
    this.LinklookBarBand.LargeImageList = igl_link;
    this.LinklookBarBand.Background = System.Drawing.SystemColors.ControlDarkDark;
    this.LinklookBarBand.TextColor = System.Drawing.Color.White;
    this.LinklookBarBand.Items.Add(new UtilityLibrary.WinControls.OutlookBarItem(" 建立链接", 0));
    this.LinklookBarBand.Items.Add(new UtilityLibrary.WinControls.OutlookBarItem(" 断开链接", 1));
    this.outLookBar.Bands.Add(LinklookBarBand);
    this.outLookBar.Dock = System.Windows.Forms.DockStyle.Fill;
    
    this.splitContainer1.Panel1.Controls.AddRange(new System.Windows.Forms.Control[] { this.outLookBar });
    this.outLookBar.ItemClicked += new UtilityLibrary.WinControls.OutlookBarItemClickedHandler(OnOutlookBarItemClicked);
    this.outLookBar.ItemDropped += new UtilityLibrary.WinControls.OutlookBarItemDroppedHandler(OnOutlookBarItemDropped);

}

三:

1: linkForm 为用于
private void OnOutlookBarItemClicked(UtilityLibrary.WinControls.OutlookBarBand band, UtilityLibrary.WinControls.OutlookBarItem item)
{
    switch (item.Text)
    {
        case " 建立链接":
            if (this.linkForm != null)
            {
                this. linkForm.Close();
                this. linkForm = null;
            }
            this. linkForm = new AddPSAMIDForm();
            ShowFormContent(this. linkForm);
            break;

        default:
            break;
    }
}

private void ShowFormContent(System.Windows.Forms.Form showForm)
{
    showForm.TopLevel = false;
    showForm.FormBorderStyle = FormBorderStyle.None;
    showForm.Dock = DockStyle.Fill;
    this.splitContainer1.Panel2.Controls.Add(showForm);
    showForm.Visible = true;
    this.splitContainer1.Panel2.Controls.SetChildIndex(showForm, 0);

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值