multiple event handling issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

when I did this :

Private Sub mydatagrid_MouseDown(ByVal sender As Object, ByVal mouseEvent As
System.Windows.Forms.MouseEventArgs, ByVal keyPressEvent As
System.Windows.Forms.KeyEventArgs) Handles mydatagrid.MouseDown
.....
end sub
I got error because it wouldn't allow pass into 2 delegrates? here? But I
wanted to be able pick up both mouse click and key press event in this
subroutine. Could you someone please tell me how do I do going about to get
it to work?

Thanks.
 
Ben said:
when I did this :

Private Sub mydatagrid_MouseDown(ByVal sender As Object, ByVal mouseEvent As
System.Windows.Forms.MouseEventArgs, ByVal keyPressEvent As
System.Windows.Forms.KeyEventArgs) Handles mydatagrid.MouseDown
....
end sub
I got error because it wouldn't allow pass into 2 delegrates? here? But I
wanted to be able pick up both mouse click and key press event in this
subroutine. Could you someone please tell me how do I do going about to get
it to work?

Thanks.


I know you can do that but you have to find the windows handle to the
defrag window and then figure out the coords to the button. It would
seem a lot easier to use the command-line utility in defag to do it.
Look in the defrag help file it talks about it in there. As to
launching the process from VB. Look at the Process class and the
Process.Start method. Also have a look at the ProcessInfo class.

Good luck
Chris
 
Chris said:
I know you can do that but you have to find the windows handle to the
defrag window and then figure out the coords to the button. It would
seem a lot easier to use the command-line utility in defag to do it.
Look in the defrag help file it talks about it in there. As to
launching the process from VB. Look at the Process class and the
Process.Start method. Also have a look at the ProcessInfo class.

Good luck
Chris

um, ya, sorry, posted to wrong message

Chris
 
Ben said:
when I did this :

Private Sub mydatagrid_MouseDown(ByVal sender As Object, ByVal
mouseEvent As System.Windows.Forms.MouseEventArgs, ByVal
keyPressEvent As
System.Windows.Forms.KeyEventArgs) Handles mydatagrid.MouseDown
....
end sub
I got error because it wouldn't allow pass into 2 delegrates? here?
But I wanted to be able pick up both mouse click and key press event
in this subroutine. Could you someone please tell me how do I do
going about to get it to work?


Not possible. Both events have different signatures.


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top