System.Windows.Forms.ToolStrip.Dismiss C# (CSharp) Method

Dismiss() private method

private Dismiss ( ToolStripDropDownCloseReason reason ) : void
reason ToolStripDropDownCloseReason
return void
		internal virtual void Dismiss (ToolStripDropDownCloseReason reason)
		{
			// Release our stranglehold on the keyboard
			//this.KeyboardActive = false;
			
			// Set our drop down flag to false;
			this.menu_selected = false;
			
			// Make sure all of our items are deselected and repainted
			foreach (ToolStripItem tsi in this.Items)
				tsi.Dismiss (reason);
				
			// We probably need to redraw for mnemonic underlines
			this.Invalidate ();
		}
		

Same methods

ToolStrip::Dismiss ( ) : void

Usage Example

Ejemplo n.º 1
0
        protected override void OnClick(EventArgs e)
        {
            if (!this.Enabled)
            {
                return;
            }

            if (this.HasDropDownItems)
            {
                base.OnClick(e);
                return;
            }

            if (this.OwnerItem is ToolStripDropDownItem)
            {
                (this.OwnerItem as ToolStripDropDownItem).OnDropDownItemClicked(new ToolStripItemClickedEventArgs(this));
            }

            if (this.IsOnDropDown)
            {
                ToolStrip ts = this.GetTopLevelToolStrip();

                if (ts != null)
                {
                    ts.Dismiss(ToolStripDropDownCloseReason.ItemClicked);
                }
            }

            if (this.IsMdiWindowListEntry)
            {
                this.mdi_client_form.MdiParent.MdiContainer.ActivateChild(this.mdi_client_form);
                return;
            }

            if (this.check_on_click)
            {
                this.Checked = !this.Checked;
            }

            base.OnClick(e);

            if (!this.IsOnDropDown && !this.HasDropDownItems)
            {
                ToolStrip ts = this.GetTopLevelToolStrip();

                if (ts != null)
                {
                    ts.Dismiss(ToolStripDropDownCloseReason.ItemClicked);
                }
            }
        }
All Usage Examples Of System.Windows.Forms.ToolStrip::Dismiss