Este artigo foi traduzido por máquina. Para visualizar o arquivo em inglês, marque a caixa de seleção Inglês. Você também pode exibir o texto Em inglês em uma janela pop-up, movendo o ponteiro do mouse sobre o texto.
Tradução
Inglês

ToolStripItem.Click Evento

Occurs when the ToolStripItem is clicked.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (em System.Windows.Forms. dll)

public event EventHandler Click

The Click event passes an EventArgs to its event handler, so it only indicates that a click has occurred.If you need more specific mouse information (button, number of clicks, wheel rotation, or location), use the MouseDown and MouseUp events which pass a MouseEventArgs to the event handler.

Um clique duplo é determinado pelas configurações do mouse do sistema operacional do usuário.O usuário pode definir o tempo entre os cliques de um botão do mouse que deve ser considerada um clique duplo em vez de dois cliques.The Click event is raised every time a control is double-clicked.For example, if you have two event handlers for the Click and DoubleClick events of a Form, the Click and DoubleClick events are raised when the form is double-clicked and both methods are called.If an item is double-clicked that does not support the DoubleClick event, the Click event might be raised twice.

The following code example demonstrates how to set the Text, Overflow, and TextDirection properties, and handle the Click event.To run this example, paste the following code into a form that contains a ToolStrip named movingToolStrip and call InitializeMovingToolStrip in the form's constructor or Load event handler.

		internal ToolStripButton changeDirectionButton;

		private void InitializeMovingToolStrip()
		{
            movingToolStrip = new ToolStrip();

			changeDirectionButton = new ToolStripButton();

			movingToolStrip.AutoSize = true;
			movingToolStrip.RenderMode = ToolStripRenderMode.System;

			changeDirectionButton.TextDirection = ToolStripTextDirection.Vertical270;
			changeDirectionButton.Overflow = ToolStripItemOverflow.Never;
			changeDirectionButton.Text = "Change Alignment";
				movingToolStrip.Items.Add(changeDirectionButton);
		}


		private void changeDirectionButton_Click(object sender, EventArgs e)
		{

			ToolStripItem item = (ToolStripItem)sender;

			if (item.TextDirection == ToolStripTextDirection.Vertical270 || item.TextDirection == ToolStripTextDirection.Vertical90)
			{
				item.TextDirection = ToolStripTextDirection.Horizontal;
				movingToolStrip.Dock = System.Windows.Forms.DockStyle.Top;
			}
			else
			{
				item.TextDirection = ToolStripTextDirection.Vertical270;
				movingToolStrip.Dock = System.Windows.Forms.DockStyle.Left;
			}

		}


Contribuições da comunidade

ADICIONAR
Mostrar: