|
-
Jun 9th, 2012, 04:08 PM
#1
Thread Starter
Hyperactive Member
raise event after mouse click?
Hi,
I have a picturebox on the form, when it is clicked, I want the picturebox to fit the size of the form, which can be done by
pic.SizeToFit = true
So, the picturebox will automatically change the size.
But after that, I want to set pic.SizeToFit = false , I need this because the picturebox is a user control which has a image Pannign feature, and it works only when the picturebox.SizeToFit = false
Now, the problem is: I can not set it = false in the mouse click event, because I need set it = true, so the pic will change size.
basically, what I need is: after mouse click event finished, change SizeToFit = false.
One way to do it is in mouse click event, start a timer, after several seconds, set SizeToFit = false. Or, use a thread. It will work. But, is there a more elegant way to do this?
thanks
bear
-
Jun 9th, 2012, 05:07 PM
#2
Re: raise event after mouse click?
are you sure setting pic.SizeToFit = false won't resize the picturebox?
you could use the _MouseUp event
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 9th, 2012, 07:13 PM
#3
Thread Starter
Hyperactive Member
Re: raise event after mouse click?
 Originally Posted by .paul.
are you sure setting pic.SizeToFit = false won't resize the picturebox?
you could use the _MouseUp event
because the picture box is a user control, not the original picture box, I'm sure size to fit = false will not change the size back.
yes, I'll try hook the MouseUp. How come I forget it, 
thanks
-
Jun 9th, 2012, 08:07 PM
#4
Re: raise event after mouse click?
Because it isn't reliable? Still, it is worth testing. There are times when MouseUp doesn't get raised, though. Drag and Drop is one such occasion and there may be others, but it doesn't sound like you are doing Drag and Drop, so that probably doesn't matter. Testing is required, though.
My usual boring signature: Nothing
 
-
Jun 10th, 2012, 07:11 AM
#5
Junior Member
Re: raise event after mouse click?
Hi flyingBear ..... if you wanna set the picbox size back you have to save the dimensions and the location of the picbox in a global parameters ...... some thing like that
vb Code:
top=picbox.top left=picbox.left size=picbox.size
And then you have you can reverse the operations
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
|