Ontani Posted May 15, 2004 Posted May 15, 2004 hey i'v got a question about how to do an event when there's click on the form... I thought with Mybase.Mousedown or so but nothing somebody has an idea? Thanx Greetz From Ontani :D Quote www.purevision.be :: www.devpoint.be
Leaders dynamic_sysop Posted May 15, 2004 Leaders Posted May 15, 2004 use the Form's MouseDown event , eg: Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown If e.Button = MouseButtons.Left Then MessageBox.Show("you clicked the Left mouse button") End If End Sub Quote
Ontani Posted May 16, 2004 Author Posted May 16, 2004 hu? for some reason this won't work Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown Dim rightClick As New rightclick() If e.Button = MouseButtons.Left Then rightclick.MdiParent = Me rightclick.Show() End If End Sub Quote www.purevision.be :: www.devpoint.be
Administrators PlausiblyDamp Posted May 16, 2004 Administrators Posted May 16, 2004 When you say it doesn't work - exactly what do you mean? does it fail to compile? Crash at runtime? Not work as expected? How is rightclick declared? Also in Vb I would recomend agains using variable names that are the same as class names - it can lead to confusion as VB isn't case sensitive. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Ontani Posted May 16, 2004 Author Posted May 16, 2004 i don't get any errors. just when i click on the form normaly an MdiChild form should popup but that doesn't do. when i use his example i don't get the messagebox either just nothing happens Greetz Quote www.purevision.be :: www.devpoint.be
Administrators PlausiblyDamp Posted May 16, 2004 Administrators Posted May 16, 2004 If you put a breakpoint on the 1st line - does it ever get executed? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Ontani Posted May 16, 2004 Author Posted May 16, 2004 what do you mean with an breakpoint? Quote www.purevision.be :: www.devpoint.be
Ontani Posted May 16, 2004 Author Posted May 16, 2004 just realised that the click on a form isn't the same then a click on the MdiParent. but my problem is now, how do i specify a click on the MdiParent Greetz Quote www.purevision.be :: www.devpoint.be
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.