Jan 2nd, 2010, 10:20 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] detect click event outside a form's boundary
ok what i have now. a form without borders through this:
Code:
Me.FormBorderStyle = FormBorderStyle.None
what is happening now: i click the area in the taskbar which "belongs" to my form, while it is being shown, the form remains "shown"
what i hope to get done: if the form is "shown" and i click the taskbar of my form, i want it hidden
questions:
could we detect click event of the form's area in the taskbar?
Jan 2nd, 2010, 10:29 PM
#2
Re: detect click event outside a form's boundary
I have no idea what you're asking. Perhaps a visualization would help?
CodeBank contributions: Process Manager , Temp File Cleaner
Originally Posted by
SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
Jan 2nd, 2010, 10:48 PM
#3
Addicted Member
Re: detect click event outside a form's boundary
Code:
Private Sub Form1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick
If e.Y > Me.Height - 100 Then
'Do Events
End If
End Sub
Could this perhaps be what you're looking for? As the above post says, I don't quite understand the question either.
Jan 2nd, 2010, 10:58 PM
#4
Re: detect click event outside a form's boundary
do you mean the forms showintaskbar button?
Coding Examples:
Features:
Online Games:
Compiled Games:
Jan 2nd, 2010, 11:04 PM
#5
Thread Starter
Hyperactive Member
Re: detect click event outside a form's boundary
yea i want to access the click of the showintaskbar's button
Jan 2nd, 2010, 11:55 PM
#6
Re: detect click event outside a form's boundary
its not a simple task.
i'm not sure how, but you need to get the taskbars window handle, then get the window handle of the button, then hook the WM_MOUSEDOWN message.
this might help
Coding Examples:
Features:
Online Games:
Compiled Games:
Jan 3rd, 2010, 12:05 AM
#7
Re: detect click event outside a form's boundary
there is an easier way, where you change your formborderstyle back to the default formborderstyle, then use this code in your form_load event, which will give your form the look of no borders with the functionality of a form with default formborderstyle:
vb Code:
Dim gp As New Drawing.Drawing2D.GraphicsPath
Dim r As Rectangle = Me.ClientRectangle
r.Offset(0, SystemInformation.CaptionHeight + 2)
gp.AddRectangle(r)
Me.Region = New Region(gp)
Coding Examples:
Features:
Online Games:
Compiled Games:
Jan 3rd, 2010, 09:49 AM
#8
Thread Starter
Hyperactive Member
Re: detect click event outside a form's boundary
hey both works great thanks. anyways this sound stupid but i cant find out how do we put the [VB 2008] tag?
Jan 3rd, 2010, 09:53 AM
#9
Re: [RESOLVED] detect click event outside a form's boundary
Attached Images
Coding Examples:
Features:
Online Games:
Compiled Games:
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width