当前位置: 首页>>代码示例>>C#>>正文


C# DataGridView.BringToFront方法代码示例

本文整理汇总了C#中System.Windows.Forms.DataGridView.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridView.BringToFront方法的具体用法?C# DataGridView.BringToFront怎么用?C# DataGridView.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.DataGridView的用法示例。


在下文中一共展示了DataGridView.BringToFront方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataForm

        public DataForm(DataTable[] tables)
        {
            InitializeComponent();
            this.m_tables = tables;

            if (tables.Length == 1)
            {
                DataGridView dgv = new DataGridView();
                dgv.Name = "dgv";
                dgv.TabIndex = 0;
                dgv.DataSource = tables[0];
                dgv.Dock = DockStyle.Fill;
                Helper.DataGridViewPropSet(dgv);
                this.Controls.Add(dgv);
                dgv.BringToFront();
            }
            else
            {
                TabControl tabControl = new TabControl();
                tabControl.Name = "tabControl";
                tabControl.Alignment = System.Windows.Forms.TabAlignment.Bottom;
                tabControl.Dock = DockStyle.Fill;
                string tableName;
                for (int i = 0; i < tables.Length; i++)
                {
                    tableName = tables[i].TableName;
                    TabPage tp = new TabPage();
                    tp.Text = string.IsNullOrEmpty(tableName) ? "Table" + (i + 1).ToString() : tableName;
                    tp.Name = "tp" + i.ToString();
                    tp.Padding = new System.Windows.Forms.Padding(0);
                    tp.TabIndex = i + 1;
                    tp.UseVisualStyleBackColor = true;
                    tabControl.TabPages.Add(tp);

                    DataGridView dgv = new DataGridView();
                    dgv.Name = "dgv" + i.ToString();
                    dgv.TabIndex = i;
                    dgv.DataSource = tables[i];
                    dgv.Dock = DockStyle.Fill;
                    Helper.DataGridViewPropSet(dgv);
                    tp.Controls.Add(dgv);
                }
                this.Controls.Add(tabControl);
                tabControl.BringToFront();
            }

            this.Load += DataForm_Load;
        }
开发者ID:fanjun365,项目名称:TheDbgTool,代码行数:48,代码来源:DataForm.cs

示例2: SetTablePropertyToCreateTamplate

	/// <summary>
	/// Задает визуальные свойства таблицы
	/// </summary>
	/// <param name="Table">Исходная таблица</param>
	public static void SetTablePropertyToCreateTamplate(DataGridView Table) 
	{
		Table.AllowUserToOrderColumns = false;
		Table.AllowUserToResizeRows = false;
		Table.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
		Table.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
		Table.AllowUserToAddRows = false;
		Table.AllowUserToDeleteRows = false;
		Table.AllowUserToResizeColumns = false;
		Table.BringToFront();
		Table.Dock = DockStyle.Fill;
		Table.BorderStyle = BorderStyle.None;
		foreach (DataGridViewColumn tmp in Table.Columns) {
			tmp.SortMode = DataGridViewColumnSortMode.NotSortable;
		}
		Table.ColumnHeadersHeight = 70;
	}
开发者ID:JDevelopBox,项目名称:Banklab,代码行数:21,代码来源:excell_functions.cs

示例3: Show

        /// <summary>
        /// Show editor for config management
        /// </summary>
        public void Show()
        {
            configForm = new Form();
            buttonClose = new Button();
            buttonCancel = new Button();
            dgView = new DataGridView();

            dgView.Parent = configForm;
            dgView.BringToFront();
            dgView.RowHeadersVisible = false;
            buttonCancel.Parent = configForm;
            buttonClose.Parent = configForm;

            configForm.Text = "Config Editor";
            configForm.FormBorderStyle = FormBorderStyle.FixedDialog;
            configForm.MaximizeBox = false;
            configForm.MinimizeBox = false;
            configForm.StartPosition = FormStartPosition.CenterParent;

            Parameterlist.Clear();
            SetSize();

            dgView.Rows.Clear();
            try
            {
                Parameterlist = Read();
            }
            catch
            {
                MessageBox.Show("File Not Found, creating SQL default");
                InitSQLDefaults();
                Parameterlist = Read();
            }

            dgView.Columns.Add("dgName", "Name");
            dgView.Columns.Add("dgValue", "Value");
            dgView.Columns["dgName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dgView.Columns["dgName"].FillWeight = 40;
            dgView.Columns["dgValue"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dgView.Columns["dgValue"].FillWeight = 60;

            foreach (CParameter x in Parameterlist)
            {
                dgView.Rows.Add();
                dgView.Rows[dgView.Rows.Count - 2].Cells[0].Value = x.Name;
                dgView.Rows[dgView.Rows.Count - 2].Cells[1].Value = x.Value;
            }

            buttonClose.Click += new EventHandler(buttonClose_Click);
            buttonCancel.Click += new EventHandler(buttonCancel_Click);
            dgView.KeyDown += new KeyEventHandler(dgView_KeyDown);

            configForm.ShowDialog();

            configForm.Dispose();
            buttonClose.Dispose();
            buttonCancel.Dispose();
            dgView.Dispose();
            GC.Collect();
        }
开发者ID:Raxo94,项目名称:QCView,代码行数:63,代码来源:CConfig.cs

示例4: addTabcontrol

        private void addTabcontrol(string devicename)
        {
            DataGridView DatagridView = new DataGridView();
            TabPage myTabPage = new TabPage(devicename); //Create each tab
            DataTable tabview = new DataTable();
            string[] columnName = { "Date", "Device", "Process", "LogLevel", "Log", "ctr"};

            foreach (string name in columnName)
            {
                DatagridView.Columns.Add(name, name);
            }

            DatagridView.DefaultCellStyle.Font = new Font("Consolas", 9);
            DatagridView.RowTemplate.Height = 80;
            DatagridView.CellBorderStyle = DataGridViewCellBorderStyle.None;
            DatagridView.AllowUserToResizeRows = true;
            DatagridView.AllowUserToAddRows = false;
            DatagridView.Columns[0].Width = 130;
            DatagridView.Columns[2].Width = 120;
            DatagridView.Columns[4].MinimumWidth = 2500;
            DatagridView.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            DatagridView.Columns[5].Width = 10;
            DatagridView.Columns[5].Visible = false;

            foreach (DataGridViewColumn col in DatagridView.Columns)
            {
                tabview.Columns.Add(col.Name);
                col.DataPropertyName = col.Name;
            }

            DatagridView.BringToFront();

            DatagridView.ScrollBars = ScrollBars.Both;
            DatagridView.Dock = DockStyle.Fill;
            DatagridView.DataSource = tabview;
            DatagridView.ContextMenuStrip = mnu;
            DatagridView.CellFormatting += dataGridView_CellFormatting;

            //add it to the list.
            dataGrids.Add(devicename, DatagridView);
            dataTables.Add(devicename, tabview);
            tabpages.Add(devicename, myTabPage);

            myTabPage.Controls.Add(DatagridView);
            myTabPage.AutoScroll = true;
            tabControl1.TabPages.Add(myTabPage);
        }
开发者ID:hyunmin90,项目名称:iosLoggerForWindows,代码行数:47,代码来源:Form1.cs


注:本文中的System.Windows.Forms.DataGridView.BringToFront方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。