SOASoft

画方软件工作室

公告

统计

2012年1月26日

DotnetBar SuperTabIControl实现 MDI效果

序言:在开发一个淘宝应用,想实现 Mdi那样的效果,但是Winform的MDI这个觉得不好,看到别人用Tab这个控件给实现了效果还不错;所以我用Dotnetbar 的SuperTabIControl 实现MDI效果;效果还是不错的;

如图所示:

实现代码:

        private void btnItemSingleMemo_Click(object sender, EventArgs e)
        {
            SingleMemoFrm singlememoFrm = new SingleMemoFrm();
            OpenForm(singlememoFrm, sender.ToString());
        }
        private void OpenForm(Form form,string  caption)
        {
            bool IsOpened = false;
            foreach (SuperTabItem tabitem in NavTabControl.Tabs)
            {
                if (tabitem.Name == caption)
                {
                    NavTabControl.SelectedTab = tabitem;
                    IsOpened = true;
                    break;
                }
            }
            if (!IsOpened)
            {
                SuperTabItem superTabItem = new SuperTabItem();
                superTabItem.Name = caption;
                superTabItem.Text = caption;
                NavTabControl.Tabs.Add(superTabItem);
                NavTabControl.SelectedTab = superTabItem;
            }
           
        }

  

posted @ 2012-01-26 16:27 HuaFang 阅读(97) 评论(0) 编辑

2011年9月21日

如何循环得到Ribbon控件里所有的ribbon tabs,ribbon bar and button item 控件

How to loop through all ribbon tabs, ribbon bar and items on WinForms Ribbon control

If you need to loop through all ribbon tabs, ribbon bars and items on each ribbon bar here is how to do it.

C#:

foreach (BaseItem item in ribbonControl1.Items)
{
    RibbonTabItem ribbonTab = item as RibbonTabItem;
    if (ribbonTab != null)
    {
        RibbonPanel panel = ribbonTab.Panel;
        foreach (Control panelControl in panel.Controls)
        {
            RibbonBar ribbonBar = panelControl as RibbonBar;
            if (ribbonBar != null)
            {
                // At this point you can simply disable each RibbonBar and that will disable all items on it
                //ribbonBar.Enabled = false;
 
                // Here is how you loop through items on RibbonBar
                foreach (BaseItem ribbonBarItem in ribbonBar.Items)
                {
                    ribbonBarItem.Enabled = false;
                }
            }
        }
    }
}


VB:

For Each item As BaseItem In ribbonControl1.Items
Dim ribbonTab As RibbonTabItem = TryCast(item, RibbonTabItem)
If ribbonTab IsNot Nothing Then
Dim panel As RibbonPanel = ribbonTab.Panel
For Each panelControl As Control In panel.Controls
Dim ribbonBar As RibbonBar = TryCast(panelControl, RibbonBar)
If ribbonBar IsNot Nothing Then
' At this point you can simply disable each RibbonBar and that will disable all items on it
'ribbonBar.Enabled = false;

' Here is how you loop through items on RibbonBar
For Each ribbonBarItem As BaseItem In ribbonBar.Items
ribbonBarItem.Enabled = False
Next
End If
Next
End If
Next

posted @ 2011-09-21 00:29 HuaFang 阅读(105) 评论(0) 编辑

2009年11月17日

关于asp.net 调用ActiveX的问题,求解

Code

这个放到一个Html 文件中是可以执行的。当我把这个html文件放到虚拟目录下时,就执行不了。或是我用asp.net建一个页。把这段代码放进去。也不能执行,

运行时提示错误:Microsoft JScript 运行时错误: 对象不支持此属性或方法

如何解决这个问题,

求解,谢谢了!

posted @ 2009-11-17 17:35 HuaFang 阅读(314) 评论(3) 编辑

2009年3月16日

这个问题怎么解决呀?帮帮忙呀

posted @ 2009-03-16 21:09 HuaFang 阅读(94) 评论(1) 编辑