By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,668 Members | 1,404 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,668 IT Pros & Developers. It's quick & easy.

multiple event handling issue

P: n/a
Ben
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.
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
Ben wrote:
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
Nov 21 '05 #2

P: n/a
Chris wrote:
Ben wrote:
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


um, ya, sorry, posted to wrong message

Chris
Nov 21 '05 #3

P: n/a
"Ben" <Be*@discussions.microsoft.com> schrieb
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
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.