Skip to main content

Mouse Click

  • April 28, 2016
  • 2 replies
  • 0 views

I need to capture the mouse button in a ListBox, done that

method-id listBox2_MouseClick final private.

procedure division using by value sender as object e as type System.Windows.Forms.MouseEventArgs.

if (e::Button = type MouseButtons::Right)

invoke type MessageBox::Show("Direito" "MMSIS")

end-if

if (e::Button = type MouseButtons::Left)

invoke type MessageBox::Show("Esquerda" "MMSIS")

end-if

if (e::Button = type MouseButtons::Middle)

invoke type MessageBox::Show("Centro" "MMSIS")

end-if

end method.

But just take the left button

2 replies

I need to capture the mouse button in a ListBox, done that

method-id listBox2_MouseClick final private.

procedure division using by value sender as object e as type System.Windows.Forms.MouseEventArgs.

if (e::Button = type MouseButtons::Right)

invoke type MessageBox::Show("Direito" "MMSIS")

end-if

if (e::Button = type MouseButtons::Left)

invoke type MessageBox::Show("Esquerda" "MMSIS")

end-if

if (e::Button = type MouseButtons::Middle)

invoke type MessageBox::Show("Centro" "MMSIS")

end-if

end method.

But just take the left button

Use o método  MouseDown que irá funcionar.

Use the MouseDown method that will work.


  • April 29, 2016

I need to capture the mouse button in a ListBox, done that

method-id listBox2_MouseClick final private.

procedure division using by value sender as object e as type System.Windows.Forms.MouseEventArgs.

if (e::Button = type MouseButtons::Right)

invoke type MessageBox::Show("Direito" "MMSIS")

end-if

if (e::Button = type MouseButtons::Left)

invoke type MessageBox::Show("Esquerda" "MMSIS")

end-if

if (e::Button = type MouseButtons::Middle)

invoke type MessageBox::Show("Centro" "MMSIS")

end-if

end method.

But just take the left button

Obrigado Altair, então era só o evento que estava erra, valeu!