• WinForm DotNetBar 动态添加DataGridView


    DataGridView dgv = new DataGridView();
    dgv.Dock = DockStyle.Fill;
    dgv.Location = new System.Drawing.Point(0, 0);
    dgv.Size = new System.Drawing.Size(794, 69);
    dgv.BackgroundColor = Color.White;
    //DataSet ds = new DataSet();
    //ds.Tables.Add(dt);
    dgv.DataSource = dt.DefaultView;

    PanelDockContainer panelDockContainerResult = new PanelDockContainer();
    panelDockContainerResult.Size = new System.Drawing.Size(794, 69);
    panelDockContainerResult.Name = "panelDockContainerResult";
    panelDockContainerResult.Controls.Add(dgv);

    DockContainerItem dockContainerItemResult = new DockContainerItem();
    dockContainerItemResult.Name = "Result";
    dockContainerItemResult.Text = "分析结果:" + text;
    dockContainerItemResult.Control = panelDockContainerResult;

    Bar barResult = new Bar();
    barResult.AccessibleDescription = "DotNetBar Bar (barResult)";
    barResult.AccessibleName = "DotNetBar Bar";
    barResult.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
    barResult.AutoSyncBarCaption = true;
    barResult.CloseSingleTab = true;
    barResult.Controls.Add(panelDockContainerResult);
    barResult.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
    barResult.GrabHandleStyle = DevComponents.DotNetBar.eGrabHandleStyle.Caption;
    barResult.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
    dockContainerItemResult});
    barResult.LayoutType = eLayoutType.DockContainer;
    barResult.Location = new System.Drawing.Point(0, 3);
    barResult.Name = "barResult";
    barResult.Size = new System.Drawing.Size(800, 105);
    barResult.Stretch = true;
    barResult.Style = eDotNetBarStyle.Metro;
    barResult.TabIndex = 0;
    barResult.TabStop = false;
    barResult.Text = "分析结果";

    barResult.Style = eDotNetBarStyle.Metro;
    //barResult.CanHide = true;
    //barResult.CanDockBottom = true;

    DockSite dockSiteResult = new DockSite();
    dockSiteResult.Dock = DockStyle.Fill;
    dockSiteResult.Controls.Add(barResult);
    dockSiteResult.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
    dockSiteResult.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer(new DevComponents.DotNetBar.DocumentBaseContainer[] {
    ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(barResult, 800, 95)))}, DevComponents.DotNetBar.eOrientation.Vertical);
    dockSiteResult.Location = new System.Drawing.Point(0, 289);
    dockSiteResult.Name = "dockSiteResult";
    dockSiteResult.Size = new System.Drawing.Size(800, 108);
    dockSiteResult.TabIndex = 10;
    dockSiteResult.TabStop = false;
    //
    this.dotNetBarManager1.BottomDockSite = dockSiteResult;
    this.Controls.Add(dockSiteResult);

  • 相关阅读:
    红黑树——面试相关
    汇编常用指令
    c++11 delete禁用函数
    【转】C++可变参数列表处理宏va_list、va_start、va_end的使用
    【转】C/C++函数调用过程分析
    引用的大小
    多线程面试
    2017.08.22网易面试问题记录
    c++ 重载->
    探究Java如何实现原子操作(atomic operation)
  • 原文地址:https://www.cnblogs.com/jordonin/p/6484366.html
Copyright © 2020-2023  润新知