/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// statusbarpanelclickeventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this StatusBarPanelClickEventHandler statusbarpanelclickeventhandler, Object sender, StatusBarPanelClickEventArgs e, AsyncCallback callback) { if (statusbarpanelclickeventhandler == null) { throw new ArgumentNullException("statusbarpanelclickeventhandler"); } return(statusbarpanelclickeventhandler.BeginInvoke(sender, e, callback, null)); }
protected virtual void OnPanelClick(StatusBarPanelClickEventArgs e) { StatusBarPanelClickEventHandler eh = (StatusBarPanelClickEventHandler)(Events [PanelClickEvent]); if (eh != null) { eh(this, e); } }
private void InitializeComponent() { iconPanel = new StatusBarPanel(); textPanel = new StatusBarPanel(); progressPanel = new StatusBarPanel(); locationPanel = new StatusBarPanel(); sizePanel = new StatusBarPanel(); ((ISupportInitialize)(iconPanel)).BeginInit(); ((ISupportInitialize)(textPanel)).BeginInit(); ((ISupportInitialize)(progressPanel)).BeginInit(); ((ISupportInitialize)(locationPanel)).BeginInit(); ((ISupportInitialize)(sizePanel)).BeginInit(); // // iconPanel // iconPanel.BorderStyle = StatusBarPanelBorderStyle.None; iconPanel.MinWidth = 20; iconPanel.Style = StatusBarPanelStyle.OwnerDraw; iconPanel.Width = 20; // // textPanel // textPanel.AutoSize = StatusBarPanelAutoSize.Spring; textPanel.BorderStyle = StatusBarPanelBorderStyle.None; textPanel.Text = "Ready"; textPanel.Width = 10; // // progressPanel // progressPanel.BorderStyle = StatusBarPanelBorderStyle.None; progressPanel.MinWidth = 0; progressPanel.Style = StatusBarPanelStyle.OwnerDraw; progressPanel.Width = 120; // // locationPanel // locationPanel.AutoSize = StatusBarPanelAutoSize.Contents; locationPanel.BorderStyle = StatusBarPanelBorderStyle.None; locationPanel.MinWidth = 1; locationPanel.Style = StatusBarPanelStyle.OwnerDraw; locationPanel.Width = 10; // // sizePanel // sizePanel.AutoSize = StatusBarPanelAutoSize.Contents; sizePanel.BorderStyle = StatusBarPanelBorderStyle.None; sizePanel.Style = StatusBarPanelStyle.OwnerDraw; sizePanel.Width = 10; // // MpeStatusBar // Panels.AddRange(new StatusBarPanel[] { iconPanel, textPanel, locationPanel, sizePanel, progressPanel }); ShowPanels = true; PanelClick += new StatusBarPanelClickEventHandler(OnPanelClick); DrawItem += new StatusBarDrawItemEventHandler(OnDrawItem); ((ISupportInitialize)(iconPanel)).EndInit(); ((ISupportInitialize)(textPanel)).EndInit(); ((ISupportInitialize)(progressPanel)).EndInit(); ((ISupportInitialize)(locationPanel)).EndInit(); ((ISupportInitialize)(sizePanel)).EndInit(); }
private void InitializeComponent() { iconPanel = new StatusBarPanel(); textPanel = new StatusBarPanel(); progressPanel = new StatusBarPanel(); locationPanel = new StatusBarPanel(); sizePanel = new StatusBarPanel(); ((ISupportInitialize) (iconPanel)).BeginInit(); ((ISupportInitialize) (textPanel)).BeginInit(); ((ISupportInitialize) (progressPanel)).BeginInit(); ((ISupportInitialize) (locationPanel)).BeginInit(); ((ISupportInitialize) (sizePanel)).BeginInit(); // // iconPanel // iconPanel.BorderStyle = StatusBarPanelBorderStyle.None; iconPanel.MinWidth = 20; iconPanel.Style = StatusBarPanelStyle.OwnerDraw; iconPanel.Width = 20; // // textPanel // textPanel.AutoSize = StatusBarPanelAutoSize.Spring; textPanel.BorderStyle = StatusBarPanelBorderStyle.None; textPanel.Text = "Ready"; textPanel.Width = 10; // // progressPanel // progressPanel.BorderStyle = StatusBarPanelBorderStyle.None; progressPanel.MinWidth = 0; progressPanel.Style = StatusBarPanelStyle.OwnerDraw; progressPanel.Width = 120; // // locationPanel // locationPanel.AutoSize = StatusBarPanelAutoSize.Contents; locationPanel.BorderStyle = StatusBarPanelBorderStyle.None; locationPanel.MinWidth = 1; locationPanel.Style = StatusBarPanelStyle.OwnerDraw; locationPanel.Width = 10; // // sizePanel // sizePanel.AutoSize = StatusBarPanelAutoSize.Contents; sizePanel.BorderStyle = StatusBarPanelBorderStyle.None; sizePanel.Style = StatusBarPanelStyle.OwnerDraw; sizePanel.Width = 10; // // MpeStatusBar // Panels.AddRange(new StatusBarPanel[] { iconPanel, textPanel, locationPanel, sizePanel, progressPanel }); ShowPanels = true; PanelClick += new StatusBarPanelClickEventHandler(OnPanelClick); DrawItem += new StatusBarDrawItemEventHandler(OnDrawItem); ((ISupportInitialize) (iconPanel)).EndInit(); ((ISupportInitialize) (textPanel)).EndInit(); ((ISupportInitialize) (progressPanel)).EndInit(); ((ISupportInitialize) (locationPanel)).EndInit(); ((ISupportInitialize) (sizePanel)).EndInit(); }