| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3347 人关注过本帖
标题:关于DevComponents.DotNetBar.sidebarpanelitem这个控件 绑定菜单事件的问题 ...
取消只看楼主 加入收藏
zsyutian
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2006-6-30
收藏
 问题点数:0 回复次数:1 
关于DevComponents.DotNetBar.sidebarpanelitem这个控件 绑定菜单事件的问题
图片附件: 游客没有浏览图片的权限,请 登录注册
private void InitMenu()
        {
            DevComponents.DotNetBar.BaseItem[] baseitem = new DevComponents.DotNetBar.BaseItem[menuStrip1.Items.Count];            
            System.Windows.Forms.ToolStripMenuItem submenuitem = new System.Windows.Forms.ToolStripMenuItem();
            for (int ii = 0; ii < menuStrip1.Items.Count; ii++)
            {
                    baseitem[ii] =  new DevComponents.DotNetBar.SideBarPanelItem();
                    baseitem[ii].Name = menuStrip1.Items[ii].Name.ToString();
                    baseitem[ii].Text = menuStrip1.Items[ii].Text.ToString();
                    submenuitem = (ToolStripMenuItem)menuStrip1.Items[ii];                    
                    DevComponents.DotNetBar.ButtonItem[] buttonitem = new DevComponents.DotNetBar.ButtonItem[submenuitem.DropDownItems.Count];
                    for (int i = 0; i < submenuitem.DropDownItems.Count; i++)
                    {
                        if (submenuitem.DropDownItems[i].Text == "" &brvbar; &brvbar; submenuitem.DropDownItems[i].Text.Trim() == "-") { continue; }
                        DevComponents.DotNetBar.ButtonItem blnitem = new DevComponents.DotNetBar.ButtonItem(submenuitem.DropDownItems[i].Name, submenuitem.DropDownItems[i].Text);//这里取得菜单的名及对应的TEXT
blnitem.Click += new System.EventHandler//在这里想绑定相对应的菜单事件不知道怎写了
                        blnitem.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.TextOnlyAlways;
                        blnitem.ImagePaddingHorizontal = 8;
                        blnitem.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
                        baseitem[ii].SubItems.Add(blnitem);
      
                    }
                    sideBar1.Panels.Add(baseitem[ii]);
                    sideBar1.Refresh();

            }
        }
搜索更多相关主题的帖子: DotNetBar 绑定 控件 菜单 SideBarPa 
2008-06-09 13:51
zsyutian
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2006-6-30
收藏
得分:0 
//搞定了,outlook样式菜单事件绑定面板
      private void sideBar1_ItemClick(object sender, EventArgs e)
        {
         
            System.Windows.Forms.ToolStripMenuItem submenuitem = new System.Windows.Forms.ToolStripMenuItem();
            if (sender is DevComponents.DotNetBar.ButtonItem)
            {
                DevComponents.DotNetBar.ButtonItem item = sender as DevComponents.DotNetBar.ButtonItem;
                for (int ii = 0; ii < menuStrip1.Items.Count; ii++)
                {
                    submenuitem = (ToolStripMenuItem)menuStrip1.Items[ii];
                    for (int iii = 0; iii < submenuitem.DropDownItems.Count; iii++)
                    {
                        if (item.Name.Trim() == submenuitem.DropDownItems[iii].Name.Trim())
                        {
                            submenuitem.DropDownItems[iii].PerformClick();

                        }
                    }
                }
            }
        }
2008-06-10 17:18
快速回复:关于DevComponents.DotNetBar.sidebarpanelitem这个控件 绑定菜单事件 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.047062 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved