本文整理汇总了C#中System.Windows.Forms.TabControl.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# TabControl.BringToFront方法的具体用法?C# TabControl.BringToFront怎么用?C# TabControl.BringToFront使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TabControl
的用法示例。
在下文中一共展示了TabControl.BringToFront方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: DoBuildChildren
protected override void DoBuildChildren(LayoutPanelBase Layout)
{
base.DoBuildChildren (Layout);
try {
TabControl pages = new TabControl ();
ParentNotePanel.Controls.Add (pages);
pages.Dock = DockStyle.Fill;
pages.BringToFront();
TabPage GridPage = new TabPage (Loc.Instance.GetString ("Advanced"));
TabPage CheckPage = new TabPage (Loc.Instance.GetString ("Checklist"));
pages.TabPages.Add (CheckPage);
pages.TabPages.Add (GridPage);
ParentNotePanel.Controls.Remove (this.Table);
GridPage.Controls.Add (this.Table);
// Set up check list
checkers = new CheckedListBox ();
checkers.Dock = DockStyle.Fill;
UpdateCheckpage (checkers);
checkers.ItemCheck+= (object sender, ItemCheckEventArgs e) => SetSaveRequired(true);
checkers.SelectedIndexChanged+= HandleSelectedIndexChanged;
preview = new TextBox();
preview.Dock = DockStyle.Bottom;
preview.Height = 75;
preview.Multiline = true;
preview.ReadOnly = true;
preview.ScrollBars = ScrollBars.Both;
CheckPage.Controls.Add (checkers);
CheckPage.Controls.Add (preview);
} catch (Exception ex) {
NewMessage.Show (ex.ToString ());
}
ToolStripMenuItem LinkedNote =
LayoutDetails.BuildMenuPropertyEdit (Loc.Instance.GetString("Linked Note: {0}"),
Notelink,
Loc.Instance.GetString ("Give a valid note's name to populate check list."),HandleNoteLinkNameChange );
ToolStripButton RefreshButton = new ToolStripButton();
RefreshButton.Text = Loc.Instance.GetString("Refresh");
RefreshButton.Click+= HandleRefreshButtonClick;
properties.DropDownItems.Add (new ToolStripSeparator());
properties.DropDownItems.Add (LinkedNote);
properties.DropDownItems.Add (RefreshButton);
}
示例3: DoBuildChildren
protected override void DoBuildChildren(LayoutPanelBase Layout)
{
base.DoBuildChildren (Layout);
if (Columns.Length < 5) {
PropertyInfo[] propertiesInfo = typeof(Market).GetProperties ();
// rebuild Submision Market Table
DataTable Table2 = CreateDataTable (propertiesInfo);
// NewMessage.Show (Table.Columns.Count.ToString ());
//ForceTableUpdate (Table2);
dataSource = Table2;
Table = new TablePanel (dataSource, HandleCellBeginEdit, Columns, GoToNote, this.Caption, GetRandomTableResults);
Table.Dock = DockStyle.Fill;
Table.BringToFront ();
dashboardMarketEdit.AddMarketRow (propertiesInfo, Table2, Market.DefaultMarket ());
}
//ToolTip Tipster = new ToolTip ();
CaptionLabel.Dock = DockStyle.Top;
Tabs = new TabControl ();
Tabs.Margin = new Padding(5);
Tabs.Dock = DockStyle.Fill;
TabPage SubmissionPage = new TabPage (Loc.Instance.GetString ("Submissions"));
TabPage MarketList = new TabPage (Loc.Instance.GetString ("Markets"));
TabPage MarketAdvanced = new TabPage (Loc.Instance.GetString ("Advanced"));
Tabs.SelectedIndexChanged += HandleSelectedIndexTabPagesChanged;
Tabs.TabPages.Add (SubmissionPage);
Tabs.TabPages.Add (MarketList);
Tabs.TabPages.Add (MarketAdvanced);
//
// SUBMISSION PAGE SETUP
//
SubmissionPanel = new dashboardSubs (dashBoardsSubmissionsIsUpdatingProject, true);
SubmissionPanel.SupressRefresh= true;
SubmissionPanel.Dock = DockStyle.Fill;
SubmissionPage.Controls.Add (SubmissionPanel);
SubmissionPanel.BringToFront ();
ToggleBetweenListAndEditSubmissions = new Button ();
ToggleBetweenListAndEditSubmissions.Dock = DockStyle.Bottom;
ToggleBetweenListAndEditSubmissions.Enabled = false;
// we use tag to disctate the text 0 = pressme to get list of submission
// 1 mean sgo back to Submission Overview
ToggleBetweenListAndEditSubmissions.Tag = 0;
UpdateToggleButtonText();
ToggleBetweenListAndEditSubmissions.Click += HandleToggleBetweenListAndEditingClick;
SubmissionPage.Controls.Add (ToggleBetweenListAndEditSubmissions);
LastQuery = new ComboBox ();
ViewOfProjectSubmissions = new ViewProjectSubmissions (GetProjectGUID, GetMarketObjectByGUID, this.Layout);
ViewOfProjectSubmissions.Visible = false;
ViewOfProjectSubmissions.Dock = DockStyle.Fill;
SubmissionPage.Controls.Add (ViewOfProjectSubmissions);
ViewOfProjectSubmissions.BringToFront ();
//
// MARKET
//
if (dataSource == null) throw new Exception("null datasource");
MarketEdit = new dashboardMarketEdit (dataSource, dashBoardsMarketUpdating, this.Layout);
MarketEdit.Dock = DockStyle.Fill;
MarketList.Controls.Add (MarketEdit);
MarketEdit.BringToFront ();
//
// Market Page (Advanced) Setup
//
ParentNotePanel.Controls.Remove (this.Table);
MarketAdvanced.Controls.Add (this.Table);
//
// Submit Footer
//
SubmitPanel = new GroupBox ();
SubmitPanel.BackColor = Color.Lavender;
SubmitPanel.ForeColor = Color.Black;
SubmitPanel.Height = 150;
SubmitPanel.Padding = new Padding(5);
SubmitPanel.Dock = DockStyle.Bottom;
SubmitPanel.Text = Loc.Instance.GetString ("ADD A SUBMISSION");
// LabelProject = new Label ();
// LabelProject.Text = DefaultProjectLabel; //Loc.Instance.GetString ("Current Project: ");
// LabelProject.Dock = DockStyle.Top;
//
// LabelMarket = new Label ();
// LabelMarket.Text = Loc.Instance.GetString ("Current Market: ");
//.........这里部分代码省略.........
示例4: loadDisplay
public Panel loadDisplay(int x, int y, int width, int height, ContainerControl container) {
Panel result = new Panel();
result.BorderStyle = BorderStyle.FixedSingle;
result.Name = display_panel_name;
result.Location = new Point(x, y);
result.Size = new Size(width, height);
result.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
dgv_display = addDGV(dgv_display_name, 3, 3, width - 6, height - 46, result);
dgv_display.CellClick += dgvDisplay_CellClicked;
foreach (string column in dgv_display_columns.Keys) {
dgv_display.Columns.Add(column, column);
}
tc_display = addTabControl(tc_display_name, detail_tabs.Keys.ToArray(),
100, 30, width - 100, height - 70, result);
tc_display.BringToFront();
field_displayer = new FieldDisplayer("Main", detail_tabs["Main"]); /**TO DO**/
List<Control> field_controls = field_displayer.getControls();
foreach (Control c in field_controls) {
tc_display.TabPages[0].Controls.Add(c);
}
int tab_width = tc_display.TabPages[1].Width;
int tab_height = tc_display.TabPages[1].Height;
description = new RichTextBox();
description.Location = new Point(6, 6);
description.Size = new Size(tab_width - 12, tab_height - 12);
description.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
tc_display.TabPages[1].Controls.Add(description);
parsed_description = new RichTextBox();
parsed_description.Location = new Point(6, 6);
parsed_description.Size = new Size(tab_width - 12, tab_height - 12);
parsed_description.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
tc_display.TabPages[2].Controls.Add(parsed_description);
btn_hide = addButton(btn_hide_name, "X", width - 20, 7, 20, 20, new EventHandler(btnHide_Click), result);
btn_hide.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
btn_hide.BringToFront();
hideDetails();
cb_per_page = addComboBox(cb_per_page_name, new string[4] { "25", "50", "75", "100" }, results_per_page.ToString(), 70, height - 31, 70, result);
cb_per_page.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
cb_per_page.SelectedIndexChanged += new EventHandler(cbPerPage_SelectionChanged);
cb_per_page.DropDownStyle = ComboBoxStyle.DropDownList;
addLabel("Per Page", 10, height - 27, result).Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
/*
tb_page_number = addTextBox(tb_page_number_name, 300, height - 30, 40, 20, result);
tb_page_number.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
tb_page_number.ReadOnly = true;
tb_page_number.BorderStyle = BorderStyle.Fixed3D;
addLabel("Number of Pages", 200, height - 27, result).Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
*/
btn_display_left = addButton(btn_display_left_name, "<", width - 123, height - 30, 35, 20, new EventHandler(btnDisplayLeft_Click), result);
btn_display_left.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
tb_current_page = addTextBox(tb_current_page_name, width - 82, height - 30, 35, 20, result);
tb_current_page.ReadOnly = true;
tb_current_page.BorderStyle = BorderStyle.Fixed3D;
tb_current_page.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
btn_display_right = addButton(btn_display_right_name, ">", width - 41, height - 30, 35, 20, new EventHandler(btnDisplayRight_Click), result);
btn_display_right.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
btn_display_refresh = addButton(btn_display_refresh_name, "Refresh", 146, height - 31, 70, 21, btnDisplayRefresh_Click, result);
btn_display_refresh.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
container.Controls.Add(result);
showDetails(); //**********************
return result;
}
示例5: DialogEdit
public DialogEdit(Control Parent, Molecule Mol, List<int> SelIdx)
{
// super(Parent, "Edit Molecule", true)
mol = Mol.Clone();
aselidx = SelIdx;
//UPGRADE_ISSUE: The following fragment of code could not be parsed and was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1156'"
bselidx = new List<int>();
for (int n = 1; n <= mol.NumBonds(); n++)
if (aselidx.IndexOf(mol.BondFrom(n)) >= 0 && aselidx.IndexOf(mol.BondTo(n)) >= 0)
bselidx.Add(n);
//UPGRADE_ISSUE: Method 'javax.swing.JDialog.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJDialogsetLayout_javaawtLayoutManager'"
//UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'"
/*
setLayout(new BorderLayout());*/
atoms = new AnonymousClassJTable(this, CompileAtomData(), new System.String[] { "#", "El", "X", "Y", "Charge", "Unpaired", "HExplicit" });
bonds = new AnonymousClassJTable1(this, CompileBondData(), new System.String[] { "#", "From", "To", "Order", "Type" });
//UPGRADE_TODO: Method 'javax.swing.table.TableColumn.setCellEditor' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1095'"
//UPGRADE_TODO: The equivalent in .NET for method 'javax.swing.table.TableColumnModel.getColumn' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
// ((System.Data.DataTable)atoms.DataSource).Columns[0].setCellEditor(null);
System.Windows.Forms.ComboBox bondTypes = new System.Windows.Forms.ComboBox();
for (int n = 0; n < BOND_TYPES.Length; n++)
bondTypes.Items.Add(BOND_TYPES[n]);
//UPGRADE_TODO: Method 'javax.swing.table.TableColumn.setCellEditor' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1095'"
//UPGRADE_TODO: The equivalent in .NET for method 'javax.swing.table.TableColumnModel.getColumn' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
//UPGRADE_ISSUE: Constructor 'javax.swing.DefaultCellEditor.DefaultCellEditor' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingDefaultCellEditor'"
// TODO: Have to see this in action before I can tel what they need to do.
// ((System.Data.DataTable)bonds.DataSource).Columns[4].setCellEditor(new DefaultCellEditor(bondTypes));
System.Windows.Forms.Panel tabAtoms = new System.Windows.Forms.Panel(), tabBonds = new System.Windows.Forms.Panel();
//UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtContainersetLayout_javaawtLayoutManager'"
//UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'"
/*
tabAtoms.setLayout(new BorderLayout());*/
//UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtContainersetLayout_javaawtLayoutManager'"
//UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'"
/*
tabBonds.setLayout(new BorderLayout());*/
//UPGRADE_ISSUE: Method 'javax.swing.JTable.setPreferredScrollableViewportSize' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTablesetPreferredScrollableViewportSize_javaawtDimension'"
// TODO: atoms.setPreferredScrollableViewportSize(new System.Drawing.Size(350, 200));
//UPGRADE_ISSUE: Method 'javax.swing.JTable.setPreferredScrollableViewportSize' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTablesetPreferredScrollableViewportSize_javaawtDimension'"
// TODO: bonds.setPreferredScrollableViewportSize(new System.Drawing.Size(350, 200));
//UPGRADE_TODO: Constructor 'javax.swing.JScrollPane.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJScrollPaneJScrollPane_javaawtComponent'"
System.Windows.Forms.ScrollableControl temp_scrollablecontrol2;
temp_scrollablecontrol2 = new System.Windows.Forms.ScrollableControl();
temp_scrollablecontrol2.AutoScroll = true;
temp_scrollablecontrol2.Controls.Add(atoms);
//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
System.Windows.Forms.Control temp_Control;
temp_Control = temp_scrollablecontrol2;
tabAtoms.Controls.Add(temp_Control);
//UPGRADE_TODO: Constructor 'javax.swing.JScrollPane.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJScrollPaneJScrollPane_javaawtComponent'"
System.Windows.Forms.ScrollableControl temp_scrollablecontrol4;
temp_scrollablecontrol4 = new System.Windows.Forms.ScrollableControl();
temp_scrollablecontrol4.AutoScroll = true;
temp_scrollablecontrol4.Controls.Add(bonds);
//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
System.Windows.Forms.Control temp_Control2;
temp_Control2 = temp_scrollablecontrol4;
tabBonds.Controls.Add(temp_Control2);
tabs = new System.Windows.Forms.TabControl();
//UPGRADE_TODO: Method 'javax.swing.JTabbedPane.addTab' was converted to 'SupportClass.TabControlSupport.AddTab' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJTabbedPaneaddTab_javalangString_javaawtComponent'"
SupportClass.TabControlSupport.AddTab(tabs, "Atoms", tabAtoms);
//UPGRADE_TODO: Method 'javax.swing.JTabbedPane.addTab' was converted to 'SupportClass.TabControlSupport.AddTab' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJTabbedPaneaddTab_javalangString_javaawtComponent'"
SupportClass.TabControlSupport.AddTab(tabs, "Bonds", tabBonds);
//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
Controls.Add(tabs);
tabs.Dock = System.Windows.Forms.DockStyle.Fill;
tabs.BringToFront();
System.Windows.Forms.Panel buttons = new System.Windows.Forms.Panel();
//UPGRADE_TODO: Constructor 'java.awt.FlowLayout.FlowLayout' was converted to 'System.Object[]' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtFlowLayoutFlowLayout_int'"
buttons.Tag = new System.Object[] { (int)System.Drawing.ContentAlignment.TopRight, 5, 5 };
buttons.Layout += new System.Windows.Forms.LayoutEventHandler(SupportClass.FlowLayoutResize);
accept = SupportClass.ButtonSupport.CreateStandardButton("Accept");
accept.Click += new System.EventHandler(this.actionPerformed);
SupportClass.CommandManager.CheckCommand(accept);
reject = SupportClass.ButtonSupport.CreateStandardButton("Reject");
reject.Click += new System.EventHandler(this.actionPerformed);
SupportClass.CommandManager.CheckCommand(reject);
//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
buttons.Controls.Add(accept);
//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
buttons.Controls.Add(reject);
//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
Controls.Add(buttons);
buttons.Dock = System.Windows.Forms.DockStyle.Bottom;
buttons.SendToBack();
// TODO: What does pack do?
// pack();
}