void Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { StatusBarPanel message = (StatusBarPanel)m_mediator.PropertyTable.GetValue("Message"); if (message != null) { message.Text = m_htmlControl.Browser.DocumentTitle; } StatusBarPanel page = (StatusBarPanel)m_mediator.PropertyTable.GetValue("PageNumber"); if (page != null) { int iStart = m_htmlControl.Browser.DocumentText.IndexOf("PageCount=\"") + 11; string sPageCount; if (iStart == 10) { sPageCount = ""; } else { int iEnd = m_htmlControl.Browser.DocumentText.Substring(iStart).IndexOf("\""); sPageCount = m_htmlControl.Browser.DocumentText.Substring(iStart, iEnd); } page.Text = sPageCount; } }
public static void SetStatusTextAndIcon(StatusBarPanel statusBarPanel, SolveState solveState) { string str = null; Icon ic = UI.IMAGES.NOT_SOLVED_ICON; if (solveState.Equals(SolveState.NotSolved)) { str = "Not Solved"; ic = UI.IMAGES.NOT_SOLVED_ICON; } else if (solveState.Equals(SolveState.SolvedWithWarning)) { str = "Solved with Warnings"; ic = UI.IMAGES.SOLVED_WITH_WARNING_ICON; } else if (solveState.Equals(SolveState.Solved)) { str = "Solved"; ic = UI.IMAGES.SOLVED_ICON; } else if (solveState.Equals(SolveState.SolveFailed)) { str = "Solve Failed"; ic = UI.IMAGES.SOLVE_FAILED_ICON; } statusBarPanel.Text = str; statusBarPanel.Icon = ic; }
public EditorControl(string AScript) { FEditStatusPanel = new StatusBarPanel(); FEditStatusPanel.AutoSize = StatusBarPanelAutoSize.Spring; FEditPositionPanel = new StatusBarPanel(); FEditPositionPanel.Alignment = HorizontalAlignment.Right; FEditPositionPanel.AutoSize = StatusBarPanelAutoSize.Contents; FEditStatusBar = new StatusBar(); FEditStatusBar.Panels.AddRange(new StatusBarPanel[] { FEditStatusPanel, FEditPositionPanel }); FEditStatusBar.ShowPanels = true; FEditStatusBar.SizingGrip = false; FTextEdit = new TextEdit(); FTextEdit.Dock = DockStyle.Fill; FTextEdit.Document.TextContent = AScript; FTextEdit.Refresh(); SuspendLayout(); Dock = DockStyle.Fill; Controls.AddRange(new Control[] { FTextEdit, FEditStatusBar }); ResumeLayout(false); }
public static void SetStatusTextAndIcon(StatusBarPanel statusBarPanel, SolveState solveState) { string str = null; Icon ic = UI.IMAGES.NOT_SOLVED_ICON; if (solveState.Equals(SolveState.NotSolved)) { str = "Not Solved"; ic = UI.IMAGES.NOT_SOLVED_ICON; } else if (solveState.Equals(SolveState.PartiallySolved)) { str = "Partially Solved"; ic = UI.IMAGES.PARTIALLY_SOLVED_ICON; } else if (solveState.Equals(SolveState.Solved)) { str = "Solved"; ic = UI.IMAGES.SOLVED_ICON; } else if (solveState.Equals(SolveState.SolveFailed)) { str = "Solve Failed"; ic = UI.IMAGES.SOLVE_FAILED_ICON; } statusBarPanel.Text = str; statusBarPanel.Icon = ic; }
private void AddStatusBar() { StatusBar main = new StatusBar(); StatusBarPanel statusPanel = new StatusBarPanel(); StatusBarPanel statusVersion = new StatusBarPanel(); StatusBarPanel dateTimePanel = new StatusBarPanel(); StatusBarPanel serverPanel = new StatusBarPanel(); statusPanel.BorderStyle = StatusBarPanelBorderStyle.Sunken; statusPanel.Text = "Usuario.- " + UserName; statusPanel.ToolTipText = UserName; statusPanel.AutoSize = StatusBarPanelAutoSize.Spring; main.Panels.Add(statusPanel); statusVersion.BorderStyle = StatusBarPanelBorderStyle.Sunken; statusVersion.Text = "SICAP V1.0.0"; statusVersion.AutoSize = StatusBarPanelAutoSize.Spring; main.Panels.Add(statusVersion); dateTimePanel.BorderStyle = StatusBarPanelBorderStyle.Raised; dateTimePanel.Text = DateTime.Today.ToLongDateString(); dateTimePanel.ToolTipText = "Fecha: " + DateTime.Today.ToString("dd/MM/yyyy"); dateTimePanel.AutoSize = StatusBarPanelAutoSize.Spring; main.Panels.Add(dateTimePanel); main.ShowPanels = true; this.Controls.Add(main); }
/// <summary> /// Set up the UI and initialize the NLP. /// </summary> public void Initialize() { MycroParser mp = new MycroParser(); XmlDocument doc = new XmlDocument(); doc.Load("MainForm.xml"); mp.Load(doc, "Form", this); form = (Form)mp.Process(); dgvKeywords = (DataGridView)mp.ObjectCollection["dgvKeywords"]; sbStatus = mp.ObjectCollection["sbStatus"] as StatusBarPanel; btnProcess = mp.ObjectCollection["btnProcess"] as Button; tbUrl = mp.ObjectCollection["tbUrl"] as TextBox; lblAlchemyKeywords = (Label)mp.ObjectCollection["lblAlchemyKeywords"]; rtbSentences = (RichTextBox)mp.ObjectCollection["rtbSentences"]; btnPrevSentence = (Button)mp.ObjectCollection["btnPrevSentence"]; btnNextSentence = (Button)mp.ObjectCollection["btnNextSentence"]; surface = (Surface)mp.ObjectCollection["surface"]; rbNeighboringSentenceKeywords = (RadioButton)mp.ObjectCollection["rbNeighboringSentenceKeywords"]; rbKeywordDirectedGraph = (RadioButton)mp.ObjectCollection["rbKeywordDirectedGraph"]; InitializeNlp(); try { Application.Run(form); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } }
private void initUI() { ClientSize = new Size(ClientSize.Width, Screen.PrimaryScreen.WorkingArea.Height - 100); if (!selectMode) { this.Text = "Otvori takmicenje"; dataGridViewUserControl1.DataGridView.MultiSelect = false; statusBar = new StatusBar(); statusBar.Parent = this; statusBar.ShowPanels = true; StatusBarPanel sbPanel1 = new StatusBarPanel(); statusBar.Panels.Add(sbPanel1); } else { this.Text = "Izaberi takmicenje"; dataGridViewUserControl1.DataGridView.MultiSelect = true; btnDelete.Visible = false; btnDelete.Enabled = false; btnOpen.Text = "OK"; } dataGridViewUserControl1.DataGridView.CellDoubleClick += new DataGridViewCellEventHandler(DataGridView_CellDoubleClick); GridColumnsInitializer.initTakmicenje(dataGridViewUserControl1); }
private void CreateStatusBar() { StatusBar mainStatusBar = new StatusBar(); StatusBarPanel statusPanel = new StatusBarPanel(); StatusBarPanel datetimePanel = new StatusBarPanel(); mainStatusBar.Dock = DockStyle.Bottom; // Set first panel properties and add to StatusBar statusPanel.BorderStyle = StatusBarPanelBorderStyle.Sunken; statusPanel.Text = "Application started. No action yet."; statusPanel.ToolTipText = "Last Activity"; statusPanel.AutoSize = StatusBarPanelAutoSize.Spring; mainStatusBar.Panels.Add(statusPanel); // Set second panel properties and add to StatusBar datetimePanel.BorderStyle = StatusBarPanelBorderStyle.Raised; datetimePanel.ToolTipText = "DateTime: " + System.DateTime.Today.ToString(); datetimePanel.Text = System.DateTime.Today.ToLongDateString(); datetimePanel.AutoSize = StatusBarPanelAutoSize.Contents; mainStatusBar.Panels.Add(datetimePanel); mainStatusBar.ShowPanels = true; // Add StatusBar to Form controls if (dockPanel.Theme.ColorPalette != null) { mainStatusBar.BackColor = System.Drawing.Color.AliceBlue; } this.Controls.Add(mainStatusBar); }
/// <summary> /// Cleans up either unmanaged resources or managed and unmanaged resources. /// </summary> /// <remarks> /// <para> /// If disposing equals true, the method has been called directly or indirectly by a user's /// code. Managed and unmanaged resources can be disposed. /// </para> /// <para> /// If disposing equals false, the method has been called by the runtime from inside the /// finalizer and you should not reference other objects. Only unmanaged resources can /// be disposed. /// </para> /// </remarks> /// <param name="disposing">Was Dispose called manually?</param> protected override void Dispose(bool disposing) { if (!isDisposed) // Check To See If Dispose Has Already Been Called { if (disposing) // If disposing Equals true, Dispose All Managed And Unmanaged Resources { sbpInformation.Dispose(); sbpResolution.Dispose(); sbpCurrentFps.Dispose(); sbpHighestFps.Dispose(); sbpLowestFps.Dispose(); timer.Dispose(); GC.SuppressFinalize(this); // Suppress Finalization } // Release Any Unmanaged Resources Here, If disposing Was false, Only The Following Code Is Executed sbpInformation = null; sbpResolution = null; sbpCurrentFps = null; sbpHighestFps = null; sbpLowestFps = null; timer = null; base.Dispose(disposing); } isDisposed = true; // Mark As disposed }
public MainForm () { // // _statusBar // _statusBar = new StatusBar (); _statusBar.ShowPanels = true; Controls.Add (_statusBar); // // _myComputerPanel // _myComputerPanel = new StatusBarPanel (); _myComputerPanel.AutoSize = StatusBarPanelAutoSize.Contents; _myComputerPanel.Icon = Icon; _myComputerPanel.Text = "My Computer"; _statusBar.Panels.Add (_myComputerPanel); // // MainForm // ClientSize = new Size (300, 60); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #82487"; Load += new EventHandler (MainForm_Load); }
public MainForm() { this.SuspendLayout(); this.Menu = new MainMenu(); /* * this.Menu.MenuItems.Add(" DB4O ").Click += (o,e) => * { * MessageBox.Show("DB40 GPL"); * }; */ StatusBar statusBar1 = new StatusBar(); statusBarPanel = new StatusBarPanel(); statusBarPanel.BorderStyle = StatusBarPanelBorderStyle.Sunken; statusBarPanel.Text = "Ready..."; statusBarPanel.AutoSize = StatusBarPanelAutoSize.Spring; statusBar1.ShowPanels = true; statusBar1.Panels.Add(statusBarPanel); this.Controls.Add(statusBar1); new DTE2Impl(this).Exec(); this.ResumeLayout(); //this.Name = "DB4O GPL Object Manager"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Height = 100; this.Width = 600; this.MaximizeBox = false; this.Text = "DB4O GPL Object Manager (pid:" + Process.GetCurrentProcess().Id + ")"; }
public DesignerControl(string AScript) { FServer = new ServerSchema(AScript); FDesignStatusPanel = new StatusBarPanel(); FDesignStatusPanel.AutoSize = StatusBarPanelAutoSize.Spring; FDesignSelectionPanel = new StatusBarPanel(); FDesignSelectionPanel.Alignment = HorizontalAlignment.Right; FDesignSelectionPanel.AutoSize = StatusBarPanelAutoSize.Contents; FDesignPositionPanel = new StatusBarPanel(); FDesignPositionPanel.Alignment = HorizontalAlignment.Right; FDesignPositionPanel.AutoSize = StatusBarPanelAutoSize.Contents; FDesignStatusBar = new StatusBar(); FDesignStatusBar.ShowPanels = true; FDesignStatusBar.SizingGrip = false; FDesignStatusBar.Panels.AddRange(new StatusBarPanel[] { FDesignStatusPanel, FDesignSelectionPanel, FDesignPositionPanel }); SuspendLayout(); Dock = DockStyle.Fill; Controls.Add(FDesignStatusBar); // Prepare designer Push(FDatabaseSurface = new DatabaseSurface(FServer.GetCatalog(), this)); ResumeLayout(false); }
public KonacanPlasmanForm(List <KonacanPlasman> plasmani, Gimnastika gimnastika) { InitializeComponent(); this.ClientSize = new System.Drawing.Size(Screen.PrimaryScreen.WorkingArea.Width - 20, 540); this.dataGridViewUserControl1.DataGridView.MouseUp += DataGridView_MouseUp; this.Text = "Rezultati"; this.gimnastika = gimnastika; statusBar = new StatusBar(); statusBar.Parent = this; statusBar.ShowPanels = true; StatusBarPanel sbPanel1 = new StatusBarPanel(); statusBar.Panels.Add(sbPanel1); initializeGridColumns(plasmani, gimnastika); dataGridViewUserControl1.GridColumnHeaderMouseClick += new EventHandler <GridColumnHeaderMouseClickEventArgs>( DataGridViewUserControl_GridColumnHeaderMouseClick); dataGridViewUserControl1.setItems <KonacanPlasman>(plasmani); dataGridViewUserControl1.sort <KonacanPlasman>( new string[] { "DatumTakmicenja" }, new ListSortDirection[] { ListSortDirection.Descending }); updatePlasmanCount(plasmani.Count); }
//menginisialisasi form public void init() { stBar.Panels.Clear(); this.Controls.Remove(btn); this.Controls.Remove(btn2); this.Controls.Remove(btn3); this.Controls.Remove(btn4); StatusBarPanel pane1 = new StatusBarPanel(); pane1.AutoSize = StatusBarPanelAutoSize.Spring; pane1.Text = "Time: 00:00:00"; stBar.Panels.Add(pane1); board.initinit(); for (int i = 0; i < 12; i++) { pentomino[i].setBackPentaminos(initialpentomino[i]); if (i >= 6) { initialpentomino[i].SetPos(500 + ((i % 6) * 150), 200); pentomino[i].SetPos(50 + ((i % 6) * 150), 500); } else { pentomino[i].SetPos(50 + ((i % 6) * 150), 350); initialpentomino[i].SetPos(500 + ((i % 6) * 150), 0); } } TStart = DateTime.Now; TimerElapsed.Enabled = false; count = 0; }
private void createStatusBar() { mainStatusBar = new StatusBar(); statusPanel = new StatusBarPanel(); datetimePanel = new StatusBarPanel(); // Set first panel properties and add to StatusBar statusPanel.BorderStyle = StatusBarPanelBorderStyle.Sunken; statusPanel.Text = "Application started. No action yet."; statusPanel.ToolTipText = "Last Activity"; statusPanel.AutoSize = StatusBarPanelAutoSize.Spring; mainStatusBar.Panels.Add(statusPanel); // Set second panel properties and add to StatusBar string sendTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); datetimePanel.BorderStyle = StatusBarPanelBorderStyle.Raised; datetimePanel.ToolTipText = "Application Start Time : " + sendTime; datetimePanel.Text = "Application Start Time : " + sendTime; datetimePanel.AutoSize = StatusBarPanelAutoSize.Contents; mainStatusBar.Panels.Add(datetimePanel); mainStatusBar.ShowPanels = true; Controls.Add(mainStatusBar); }
private void InitializeStatusBarPanels() { StatusBar1 = new StatusBar(); // Create two StatusBarPanel objects. StatusBarPanel panel1 = new StatusBarPanel(); StatusBarPanel panel2 = new StatusBarPanel(); // Set the style of the panels. // panel1 will be owner-drawn. panel1.Style = StatusBarPanelStyle.OwnerDraw; // The panel2 object will be drawn by the operating system. panel2.Style = StatusBarPanelStyle.Text; // Set the text of both panels to the same date string. panel1.Text = System.DateTime.Today.ToShortDateString(); panel2.Text = System.DateTime.Today.ToShortDateString(); // Add both panels to the StatusBar. StatusBar1.Panels.Add(panel1); StatusBar1.Panels.Add(panel2); // Make panels visible by setting the ShowPanels // property to True. StatusBar1.ShowPanels = true; // Associate the event-handling method with the DrawItem event // for the owner-drawn panel. StatusBar1.DrawItem += new StatusBarDrawItemEventHandler(DrawCustomStatusBarPanel); this.Controls.Add(StatusBar1); }
protected void SetStatusLine(int index, string value) { StatusBarPanel panel; if (index < 0) { return; } else if (index >= fStatusBar.Panels.Count) { while (index >= fStatusBar.Panels.Count) { panel = new StatusBarPanel(); fStatusBar.Panels.Add(panel); } } panel = fStatusBar.Panels[index]; panel.Text = value; for (int i = 0; i < fStatusBar.Panels.Count; i++) { fStatusBar.Panels[i].AutoSize = StatusBarPanelAutoSize.Contents; } fStatusBar.Panels[fStatusBar.Panels.Count - 1].AutoSize = StatusBarPanelAutoSize.Spring; }
public static void Create(Form Parent) { StatusBar Instance = new StatusBar(); Instance.Parent = Parent; Parent.Controls.Add(Instance); Panel = new StatusBarPanel(); Panel.BorderStyle = StatusBarPanelBorderStyle.Sunken; Panel.AutoSize = StatusBarPanelAutoSize.Spring; Rect1 = new StatusBarPanel(); Rect1.BorderStyle = StatusBarPanelBorderStyle.Sunken; Rect1.Width = 70; Rect1.Alignment = HorizontalAlignment.Center; Rect2 = new StatusBarPanel(); Rect2.BorderStyle = StatusBarPanelBorderStyle.Sunken; Rect2.Width = 70; Rect2.Alignment = HorizontalAlignment.Center; Instance.ShowPanels = true; Instance.Panels.Add(Panel); Instance.Panels.Add(Rect1); Instance.Panels.Add(Rect2); ShowText(" Ready"); }
public void ItemByKeyTest() { StatusBar bar = new StatusBar(); StatusBar.StatusBarPanelCollection c = new StatusBar.StatusBarPanelCollection(bar); StatusBarPanel panel1 = new StatusBarPanel(); StatusBarPanel panel2 = new StatusBarPanel(); StatusBarPanel panel3 = new StatusBarPanel(); StatusBarPanel panel4 = new StatusBarPanel(); StatusBarPanel panel5 = new StatusBarPanel(); panel1.Name = "p1"; panel2.Name = "p2"; panel3.Name = "P2"; panel4.Name = ""; panel5.Name = null; c.AddRange(new StatusBarPanel [] { panel1, panel2, panel3, panel4, panel5 }); Assert.AreEqual(null, c [""], "#1"); Assert.AreEqual(null, c [null], "#2"); Assert.AreEqual(panel1, c ["p1"], "#3"); Assert.AreEqual(panel1, c ["P1"], "#4"); Assert.AreEqual(panel2, c ["p2"], "#5"); Assert.AreEqual(panel2, c ["P2"], "#6"); Assert.AreEqual(null, c ["p3"], "#7"); Assert.AreEqual(null, c ["p"], "#8"); }
public void AddRemoveTest() { StatusBar bar = new StatusBar(); StatusBar.StatusBarPanelCollection collection = new StatusBar.StatusBarPanelCollection(bar); StatusBarPanel panel = new StatusBarPanel(); StatusBarPanel panel2 = new StatusBarPanel(); collection.Add(panel); Assert.AreEqual(1, collection.Count, "#1"); collection.Remove(panel); Assert.AreEqual(0, collection.Count, "#2"); collection.Add(panel); collection.RemoveAt(0); Assert.AreEqual(0, collection.Count, "#3"); collection.Add(panel); Assert.AreEqual(0, collection.IndexOf(panel), "#4"); Assert.AreEqual(-1, collection.IndexOf(panel2), "#5"); collection.Add(panel2); Assert.AreEqual(1, collection.IndexOf(panel2), "#6"); collection.RemoveAt(0); Assert.AreEqual(0, collection.IndexOf(panel2), "#7"); Assert.AreEqual(1, collection.Count, "#8"); Assert.AreEqual(false, collection.Contains(panel), "#9"); Assert.AreEqual(true, collection.Contains(panel2), "#10"); }
/// <summary> /// I like status bars. Status bars are good. /// </summary> public PresentationStatusBar() { // Pri4: It occurs to me that messages on a status bar can be much like a stack in // that a new message can occur when one is already being displayed. Maybe we should // make a nice statusBar that has a built-in stack to push & pop messages (as well // as clear the stack). this.ShowPanels = true; messagePanel = new StatusBarPanel(); messagePanel.Style = StatusBarPanelStyle.Text; messagePanel.BorderStyle = StatusBarPanelBorderStyle.Sunken; messagePanel.AutoSize = StatusBarPanelAutoSize.Spring; pagePanel = new StatusBarPanel(); pagePanel.Style = StatusBarPanelStyle.Text; pagePanel.BorderStyle = StatusBarPanelBorderStyle.Sunken; pagePanel.AutoSize = StatusBarPanelAutoSize.Contents; pagePanel.Alignment = HorizontalAlignment.Center; pagePanel.MinWidth = 100; pagePanel.Text = @"Slide -- of --"; this.Panels.Add(messagePanel); this.Panels.Add(pagePanel); }
private void initComponents() { initMenus(); statBar = new StatusBarPanel(); statBar.Text = "Status "; statBar.AutoSize = StatusBarPanelAutoSize.Spring; lineBar = new StatusBarPanel(); lineBar.Text = "(xxx,yyy)"; lineBar.AutoSize = StatusBarPanelAutoSize.Contents; lineBar.BorderStyle = StatusBarPanelBorderStyle.Raised; stat = new StatusBar(); stat.Panels.Add(statBar); stat.Panels.Add(lineBar); stat.ShowPanels = true; Controls.Add(stat); fontFam = new FontFamily("Courier New"); edtFont = new Font(fontFam, 12); edtBox = new RichTextBox(); edtBox.Dock = DockStyle.Fill; edtBox.Font = edtFont; Controls.Add(edtBox); fntDlg = new FontDialog(); fntDlg.ShowColor = true; opFlDlg = new OpenFileDialog(); savFlDlg = new SaveFileDialog(); }
public void IndexByKeyTest() { StatusBar bar = new StatusBar(); StatusBar.StatusBarPanelCollection c = new StatusBar.StatusBarPanelCollection(bar); StatusBarPanel panel1 = new StatusBarPanel(); StatusBarPanel panel2 = new StatusBarPanel(); StatusBarPanel panel3 = new StatusBarPanel(); StatusBarPanel panel4 = new StatusBarPanel(); StatusBarPanel panel5 = new StatusBarPanel(); panel1.Name = "p1"; panel2.Name = "p2"; panel3.Name = "P2"; panel4.Name = ""; panel5.Name = null; c.AddRange(new StatusBarPanel [] { panel1, panel2, panel3, panel4, panel5 }); Assert.AreEqual(-1, c.IndexOfKey(""), "#1"); Assert.AreEqual(-1, c.IndexOfKey(null), "#2"); Assert.AreEqual(0, c.IndexOfKey("p1"), "#3"); Assert.AreEqual(0, c.IndexOfKey("P1"), "#4"); Assert.AreEqual(1, c.IndexOfKey("p2"), "#5"); Assert.AreEqual(1, c.IndexOfKey("P2"), "#6"); Assert.AreEqual(-1, c.IndexOfKey("p3"), "#7"); Assert.AreEqual(-1, c.IndexOfKey("p"), "#8"); }
public void MinWidth_AutoSize_None() { StatusBarPanel p = new StatusBarPanel(); p.Width = 50; Assert.AreEqual(10, p.MinWidth, "#1"); }
private void InitializeComponent() { fStatusBar = new StatusBar(); sbpCurrentFps = new StatusBarPanel(); sbpKeysControl = new StatusBarPanel(); SuspendLayout(); sbpCurrentFps.Alignment = HorizontalAlignment.Center; sbpCurrentFps.AutoSize = StatusBarPanelAutoSize.Contents; sbpCurrentFps.Text = "Current: -- FPS"; sbpKeysControl.Alignment = HorizontalAlignment.Left; sbpKeysControl.AutoSize = StatusBarPanelAutoSize.Contents; sbpKeysControl.Text = "Debug (D); Free-rotate (R); Time stop (T)"; fStatusBar.Panels.AddRange(new StatusBarPanel[] { sbpCurrentFps, sbpKeysControl }); fStatusBar.ShowPanels = true; fTreeVizView = new TreeVizControl(); fTreeVizView.Parent = this; fTreeVizView.Dock = DockStyle.Fill; Controls.AddRange(new Control[] { fTreeVizView, fStatusBar }); Size = new Size(800, 600); StartPosition = FormStartPosition.CenterScreen; SizeChanged += Form_SizeChanged; Activated += Form_Activated; Load += Form_Load; Closing += Form_Closed; ResumeLayout(); }
//<snippet1> private void CreateMyStatusBar() { // Create a StatusBar control. StatusBar statusBar1 = new StatusBar(); // Create two StatusBarPanel objects to display in the StatusBar. StatusBarPanel panel1 = new StatusBarPanel(); StatusBarPanel panel2 = new StatusBarPanel(); // Display the first panel with a sunken border style. panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken; // Initialize the text of the panel. panel1.Text = "Ready..."; // Set the AutoSize property to use all remaining space on the StatusBar. panel1.AutoSize = StatusBarPanelAutoSize.Spring; // Display the second panel with a raised border style. panel2.BorderStyle = StatusBarPanelBorderStyle.Raised; // Create ToolTip text that displays time the application was started. panel2.ToolTipText = "Started: " + System.DateTime.Now.ToShortTimeString(); // Set the text of the panel to the current date. panel2.Text = System.DateTime.Today.ToLongDateString(); // Set the AutoSize property to size the panel to the size of the contents. panel2.AutoSize = StatusBarPanelAutoSize.Contents; // Display panels in the StatusBar control. statusBar1.ShowPanels = true; // Add both panels to the StatusBarPanelCollection of the StatusBar. statusBar1.Panels.Add(panel1); statusBar1.Panels.Add(panel2); // Add the StatusBar to the form. this.Controls.Add(statusBar1); }
public Program() { this.Size = new Size(700, 400); this.Text = Application.StartupPath; this.Font = new Font(FontFamily.GenericSansSerif, 8); MainMenu mm = new MainMenu(); MenuItem mi1 = new MenuItem(text: "&File"); mi1.MenuItems.Add(new MenuItem("&Open directory", new EventHandler(mi2_Click))); mi1.MenuItems.Add(new MenuItem("&Save", new EventHandler(mi3_Click))); mi1.MenuItems.Add(new MenuItem("-")); mi1.MenuItems.Add(new MenuItem(text: "&Exit", onClick: (sender, args) => Application.Exit())); mm.MenuItems.Add(mi1); this.Menu = mm; sb = new StatusBar(); sbp1 = new StatusBarPanel(); sbp2 = new StatusBarPanel(); sb.Panels.Add(sbp1); sb.Panels.Add(sbp2); sb.ShowPanels = true; this.Controls.Add(sb); sbp1.Text = "-"; sbp1.AutoSize = StatusBarPanelAutoSize.Spring; sbp2.Text = System.DateTime.Today.ToLongDateString(); sbp2.AutoSize = StatusBarPanelAutoSize.Contents; splitContainer = new SplitContainer(); splitContainer.Location = new Point(3, 3); splitContainer.Size = new Size(this.Width - 23, this.Height - sb.Height - 45); splitContainer.BorderStyle = BorderStyle.FixedSingle; splitContainer.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); splitContainer.Panel1.BackColor = Color.FloralWhite; splitContainer.Panel2.BackColor = Color.GhostWhite; //splitContainer.Panel1.MouseMove += new MouseEventHandler(Panel_MouseMove); Controls.Add(splitContainer); treeView = new TreeView(); treeView.Dock = DockStyle.Fill; treeView.NodeMouseClick += new TreeNodeMouseClickEventHandler(treeView_NodeMouseClick); treeView.MouseDoubleClick += new MouseEventHandler(treeView_MouseDoubleClick); treeView.MouseMove += new MouseEventHandler(treeView_MouseMove); splitContainer.Panel1.Controls.Add(treeView); listView = new ListView(); listView.Dock = DockStyle.Fill; listView.View = View.Details; listView.GridLines = true; listView.Columns.Add("Kulcs"); listView.Columns.Add("Érték"); splitContainer.Panel2.Controls.Add(listView); FillTreeView(Environment.CurrentDirectory); //tt = new ToolTip(); //tt.ShowAlways = true; }
public void MinimumWidth2() { StatusBarPanel p = new StatusBarPanel(); p.Width = 50; p.MinWidth = 100; Assert.AreEqual(100, p.Width, "1"); }
public ToolArgs(Bitmap bmp, PictureBox picBox, StatusBarPanel p1, StatusBarPanel p2, IPaintSettings settings) { bitmap = bmp; pictureBox = picBox; panel1 = p1; panel2 = p2; this.settings = settings; }
private void AutoDisplay(StatusBarPanel panel, string text) { Graphics g = Graphics.FromHwnd(Handle); SizeF sizeNeeded = g.MeasureString(text, Font); panel.Width = Math.Max((int)sizeNeeded.Width + 2, 60); panel.Text = text; }
/// <summary> /// Cleans up either unmanaged resources or managed and unmanaged resources. /// </summary> /// <remarks> /// <para> /// If disposing equals true, the method has been called directly or indirectly by a user's /// code. Managed and unmanaged resources can be disposed. /// </para> /// <para> /// If disposing equals false, the method has been called by the runtime from inside the /// finalizer and you should not reference other objects. Only unmanaged resources can /// be disposed. /// </para> /// </remarks> /// <param name="disposing">Was Dispose called manually?</param> protected override void Dispose(bool disposing) { if (!isDisposed) // Check To See If Dispose Has Already Been Called { if (disposing) // If disposing Equals true, Dispose All Managed And Unmanaged Resources { if (rtbInformation != null) { rtbInformation.Dispose(); } if (dgInputHelp != null) { dgInputHelp.Dispose(); } if (sbpCurrentFps != null) { sbpCurrentFps.Dispose(); } if (sbpHighestFps != null) { sbpHighestFps.Dispose(); } if (sbpLowestFps != null) { sbpLowestFps.Dispose(); } if (sbpOpenGlResolution != null) { sbpOpenGlResolution.Dispose(); } if (sbpWindowResolution != null) { sbpWindowResolution.Dispose(); } if (statusBar != null) { statusBar.Dispose(); } if (timer != null) { timer.Dispose(); } GC.SuppressFinalize(this); // Prevent Being Added To The Finalization Queue } // Release Any Unmanaged Resources Here, If disposing Was false, Only The Following Code Is Executed rtbInformation = null; dgInputHelp = null; sbpCurrentFps = null; sbpHighestFps = null; sbpLowestFps = null; sbpOpenGlResolution = null; sbpWindowResolution = null; statusBar = null; timer = null; } isDisposed = true; // Mark As disposed }
public MainForm () { _listView = new ListView (); _listView.Dock = DockStyle.Fill; _listView.View = View.Details; _listView.Items.Add ("item 1"); _listView.Items.Add ("item 2"); _listView.Items.Add ("item 3"); #if NET_2_0 _listView.MouseClick += new MouseEventHandler (ListView_MouseClick); #endif _listView.MouseMove += new MouseEventHandler (ListView_MouseMove); Controls.Add (_listView); // // _nameColumnHeader // _nameColumnHeader = new ColumnHeader (); _nameColumnHeader.Text = "Name"; _listView.Columns.Add (_nameColumnHeader); // // _statusBar // _statusBar = new StatusBar (); _statusBar.ShowPanels = true; Controls.Add (_statusBar); // // _activeItemPanel // _activeItemPanel = new StatusBarPanel(); _activeItemPanel.AutoSize = StatusBarPanelAutoSize.Contents; _activeItemPanel.MinWidth = 30; _statusBar.Panels.Add (_activeItemPanel); // // _hitItemPanel // _hitItemPanel = new StatusBarPanel (); _hitItemPanel.AutoSize = StatusBarPanelAutoSize.Spring; _statusBar.Panels.Add (_hitItemPanel); // // MainForm // ClientSize = new Size (300, 300); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #82004"; Load += new EventHandler (MainForm_Load); }
public OldStatusBar() { this.Text = "StatusBar 예제. 닷넷 1.x 형태"; StatusBar sb = new StatusBar(); sb.Parent = this; sb.ShowPanels = true; sbp1 = new StatusBarPanel(); sbp1.Text = DateTime.Now.ToLongTimeString(); sb.Panels.Add(sbp1); StatusBarPanel sbp2 = new StatusBarPanel(); sbp2.Text = "상태바 예제~"; sbp2.Width = 200; sbp2.ToolTipText = "상태바 툴팁"; sbp2.BorderStyle = StatusBarPanelBorderStyle.Raised; sb.Panels.Add(sbp2); Timer time = new Timer(); time.Tick += new EventHandler(Time_Tick); time.Interval = 1000; time.Start(); }
public iPhoneDiskApplication() { #region GUI preparation Text = "jPhone"; MaximizeBox = false; Size = new Size(nDefaultWidth, nHeightWithoutDebugLog); FormBorderStyle = FormBorderStyle.FixedSingle; ShowIcon = true; iApplication = new Icon(GetType(), "jphone.icons.icon.ico"); Icon = iApplication; FormClosing += new FormClosingEventHandler(iPhoneDiskApplication_FormClosing); SizeChanged += new EventHandler(iPhoneDiskApplication_SizeChanged); Show(); niTrayIcon = new NotifyIcon(); niTrayIcon.Text = "jPhone"; niTrayIcon.Icon = Icon; niTrayIcon.Click += new EventHandler(niTrayIcon_Click); lbText = new Label(); lbText.AutoSize = true; lbText.Location = new Point(10, 10); lbText.Text = "Select the iPhone, iPod Touch or iPad to mount:"; cbDeviceList = new ComboBox(); cbDeviceList.Location = new Point(lbText.Left + 5, lbText.Bottom); cbDeviceList.Width = 320; cbDeviceList.DropDownStyle = ComboBoxStyle.DropDownList; buMount = new Button(); buMount.Location = new Point(cbDeviceList.Right + 15, cbDeviceList.Top - 3); buMount.Size = new Size(80, 25); buMount.Click += new EventHandler(buMount_Click); buMount.Enabled = false; cmOptions = new ContextMenuStrip(); cmOptions.RenderMode = ToolStripRenderMode.System; cmOptions.ShowImageMargin = false; cmOptions.ShowCheckMargin = true; tsmiAutomount = new ToolStripMenuItem("Automount", null, (s, e) => { tsmiAutomount.Checked = !tsmiAutomount.Checked; }); tsmiMinimizeToTray = new ToolStripMenuItem("Minimize to tray", null, (s, e) => { tsmiMinimizeToTray.Checked = !tsmiMinimizeToTray.Checked; }); tsmiShowDebugLog = new ToolStripMenuItem("Show debug log", null, (s, e) => { tsmiShowDebugLog.Checked = !tsmiShowDebugLog.Checked; if (bShowDebugLog) Height = nHeightWithDebugLog; else Height = nHeightWithoutDebugLog; }); tsmiReapplyLibUSBFilters = new ToolStripMenuItem("Re-apply libusb filters", null, ReapplyLibUSBFilters_Click); cmOptions.Items.Add(tsmiAutomount); cmOptions.Items.Add(tsmiShowDebugLog); cmOptions.Items.Add(tsmiMinimizeToTray); cmOptions.Items.Add("-"); cmOptions.Items.Add(tsmiReapplyLibUSBFilters); buOptions = new Button(); buOptions.Location = new Point(buMount.Right + 5, buMount.Top); buOptions.Size = new Size(80, 25); buOptions.Text = "Options"; buOptions.Click += (s, e) => { cmOptions.Show(PointToScreen(new Point(buOptions.Left, buOptions.Bottom))); }; bool[] bOptions = GetRegistryOptions(); tsmiAutomount.Checked = bOptions[0]; tsmiShowDebugLog.Checked = bOptions[1]; tsmiMinimizeToTray.Checked = bOptions[2]; if (bShowDebugLog) Height = nHeightWithDebugLog; tbDebugLog = new TextBox(); tbDebugLog.ReadOnly = true; tbDebugLog.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right; tbDebugLog.Location = new Point(10, 75); tbDebugLog.Size = new Size(ClientSize.Width - 20, nHeightWithDebugLog - 145); tbDebugLog.Multiline = true; tbDebugLog.BorderStyle = BorderStyle.FixedSingle; tbDebugLog.ScrollBars = ScrollBars.Vertical; sbStatus = new StatusBar(); sbStatus.Dock = DockStyle.Bottom; sbStatus.SizingGrip = false; sbStatus.ShowPanels = true; sbpDeviceCount = new StatusBarPanel(); sbpDeviceCount.Width = 150; sbpDeviceCount.Alignment = HorizontalAlignment.Center; sbpMountStatus = new StatusBarPanel(); sbpMountStatus.AutoSize = StatusBarPanelAutoSize.Spring; sbpMountStatus.Alignment = HorizontalAlignment.Center; sbStatus.Panels.Add(sbpDeviceCount); sbStatus.Panels.Add(sbpMountStatus); Controls.AddRange(new Control[] { lbText, cbDeviceList, buMount, buOptions, sbStatus, tbDebugLog }); cbDeviceList.Select(); #endregion Global.LogUpdated += new Global.LogEventHandler(Global_LogUpdated); USBNotifier.OnDeviceNotify += new EventHandler<DeviceNotifyEventArgs>(USBNotifier_OnDeviceNotify); Global.Log("jPhone 1.0: iPhone mounting utility. Copyright 2010 Jonathan Bergknoff.\n"); Global.Log("Shift-click the mount button to mount a jailbroken device as root.\n"); Global.Log("http://www.getjpod.com/jphone\n"); // Initialize everything to an unmounted state. UnmountDevice(); PopulateDeviceList(); TryAutomount(); }
//To Load StatusBar Panels private void Statusbar() { string[] strToolTip={"Line:1","Col:1","","Time"}; for(int i=0;i<strToolTip.Length;i++) { StatusBarPanel sbPanel=new StatusBarPanel(); sbPanel.Text=strToolTip[i]; sbPanel.BorderStyle=StatusBarPanelBorderStyle.Raised; if(strToolTip[i].Length==0) sbPanel.Width=500; sbCPad.Panels.Add(sbPanel); if(strToolTip[i]=="Time") Timer_Tick(null,null); } tmrCPad=new Timer(); tmrCPad.Interval=1000; tmrCPad.Tick+=new EventHandler(Timer_Tick); tmrCPad.Start(); }
public MainForm () { SuspendLayout (); // // _showPanelsCheck // _showPanelsCheck = new CheckBox (); _showPanelsCheck.Checked = true; _showPanelsCheck.Location = new Point (8, 8); _showPanelsCheck.Size = new Size (80, 20); _showPanelsCheck.CheckedChanged += new EventHandler (ShowPanelsCheck_CheckedChanged); _showPanelsCheck.Text = "Panels"; Controls.Add (_showPanelsCheck); // // _largeTextCheck // _largeTextCheck = new CheckBox (); _largeTextCheck.Checked = false; _largeTextCheck.Location = new Point (100, 8); _largeTextCheck.Size = new Size (100, 20); _largeTextCheck.CheckedChanged += new EventHandler (LargeTextCheck_CheckedChanged); _largeTextCheck.Text = "Large Text"; Controls.Add (_largeTextCheck); // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Bottom; _tabControl.Height = 265; Controls.Add (_tabControl); // // _statusBar // _statusBar = new StatusBar (); _statusBar.Dock = DockStyle.Bottom; _statusBar.Name = "_statusBar"; _statusBar.ShowPanels = true; _statusBar.TabIndex = 0; _statusBar.Text = "_statusBar"; Controls.Add (_statusBar); // // _statusBarPanel1 // _statusBarPanel1 = new StatusBarPanel (); ((ISupportInitialize) (_statusBarPanel1)).BeginInit (); _statusBarPanel1.AutoSize = StatusBarPanelAutoSize.Contents; _statusBarPanel1.Width = 10; _statusBarPanel1.Text = "Bye"; _statusBar.Panels.Add (_statusBarPanel1); // // _statusBarPanel2 // _statusBarPanel2 = new StatusBarPanel (); ((ISupportInitialize) (_statusBarPanel2)).BeginInit (); _statusBarPanel2.AutoSize = StatusBarPanelAutoSize.None; _statusBarPanel2.Width = 30; _statusBarPanel2.Text = "Ok"; _statusBar.Panels.Add (_statusBarPanel2); // // _statusBarPanel3 // _statusBarPanel3 = new StatusBarPanel (); ((ISupportInitialize) (_statusBarPanel3)).BeginInit (); _statusBarPanel3.AutoSize = StatusBarPanelAutoSize.Spring; _statusBarPanel3.Width = 10; _statusBarPanel3.Text = "Rock"; _statusBar.Panels.Add (_statusBarPanel3); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Expected result on start-up:{0}{0}" + "1. The first panel shows the text \"Bye\".{0}{0}" + "2. The second panel shows the text \"Ok\".{0}{0}" + "3. The third panel shows the text \"Rock\".{0}{0}" + "4. The first and second panel are about 5 pixels wider than the " + "text in them.{0}{0}" + "5. The third panel fills the remaining part of the status bar.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // _bugDescriptionText2 // _bugDescriptionText2 = new TextBox (); _bugDescriptionText2.Dock = DockStyle.Fill; _bugDescriptionText2.Multiline = true; _bugDescriptionText2.Text = string.Format (CultureInfo.InvariantCulture, "Steps to reproduce:{0}{0}" + "1. Check the Large Text checkbox.{0}{0}" + "Expected result:{0}{0}" + "1. The first panel shows the text \"Hello world\".{0}{0}" + "2. The second panel shows the text \"Or\".{0}{0}" + "3. The third panel shows the text \"Rock is not dead\".{0}{0}" + "4. The first and second panel are about 5 pixels wider than the " + "text in them.{0}{0}" + "5. The third panel fills the remaining part of the status bar.", Environment.NewLine); // // _tabPage2 // _tabPage2 = new TabPage (); _tabPage2.Text = "#2"; _tabPage2.Controls.Add (_bugDescriptionText2); _tabControl.Controls.Add (_tabPage2); // // _bugDescriptionText1 // _bugDescriptionText3 = new TextBox (); _bugDescriptionText3.Dock = DockStyle.Fill; _bugDescriptionText3.Multiline = true; _bugDescriptionText3.Text = string.Format (CultureInfo.InvariantCulture, "Steps to reproduce:{0}{0}" + "1. Check the Large Text checkbox.{0}{0}" + "1. Uncheck the Large Text checkbox.{0}{0}" + "Expected result:{0}{0}" + "1. The first panel shows the text \"Bye\".{0}{0}" + "2. The second panel shows the text \"Ok\".{0}{0}" + "3. The third panel shows the text \"Rock\".{0}{0}" + "4. The first and second panel are about 5 pixels wider than the " + "text in them.{0}{0}" + "5. The third panel fills the remaining part of the status bar.", Environment.NewLine); // // _tabPage3 // _tabPage3 = new TabPage (); _tabPage3.Text = "#3"; _tabPage3.Controls.Add (_bugDescriptionText3); _tabControl.Controls.Add (_tabPage3); // // MainForm // AutoScaleBaseSize = new Size (5, 13); ClientSize = new Size (456, 325); StartPosition = FormStartPosition.CenterScreen; Text = "bug #80031"; ((ISupportInitialize) (_statusBarPanel2)).EndInit (); ((ISupportInitialize) (_statusBarPanel1)).EndInit (); ResumeLayout (false); }
// Constructors public StatusBarPanelClickEventArgs(StatusBarPanel statusBarPanel, MouseButtons button, int clicks, int x, int y) { }
public virtual int Add(StatusBarPanel value) { }
public StatusBarDrawItemEventArgs(System.Drawing.Graphics g, System.Drawing.Font font, System.Drawing.Rectangle r, int itemId, DrawItemState itemState, StatusBarPanel panel, System.Drawing.Color foreColor, System.Drawing.Color backColor) { }
public virtual void Remove(StatusBarPanel value) { }
public virtual void Insert(int index, StatusBarPanel value) { }
public int IndexOf(StatusBarPanel panel) { }
public bool Contains(StatusBarPanel panel) { }
public virtual void AddRange(StatusBarPanel[] panels) { }