zoukankan      html  css  js  c++  java
  • 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);

  • 相关阅读:
    2012第50周星期日
    2012第51周星期一
    2012第51周星期三
    2012第51周六
    2012第52周一
    2012第51周五冬至
    2012第51周星期二
    2012第52周二
    2012年第51周日
    2012第51周星期四
  • 原文地址:https://www.cnblogs.com/jordonin/p/6484366.html
Copyright © 2011-2022 走看看