Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi, I have a problem here. See if you guys know how to solve this please!

 

I have a form, within it is a picture box and other buttons etc...

i want it so that when my form resizes, my picture box will resize accordingly

 

However, when i put this.SizeChange += .... the event handler and change the picture box size as the form size changes, i noticed that when i drag the form to resize, i tries to resize a bunch of times.

 

Is there a way to make it resize only when i finish dragging the form. IE: when the mouse button is released?

 

this.MouseUp doesn't work since dragging the form is not part of the client window. Any suggestions would be nice

Thanks~!

  • *Experts*
Posted

Have you tried the Anchor property of the PictureBox? It should handle the resizing automagically.

 

-nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
Have you tried the Anchor property of the PictureBox? It should handle the resizing automagically.

 

-nerseus

 

yes but that stretches it unproportionatly.

I just noticed the FAQ provided within this website actually has a method that is used with eventhandler to do this.

 

It forces the layout to change only when u stop draggin. Therefore u can do ur calculation and fix the proportion after the user finishs dragging

its pretty neat. dunno if its the most efficent way to do it thou

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...