Unsaon pag set so that dili jud mulapas ang form outside sa desktop?
Unsaon pag set so that dili jud mulapas ang form outside sa desktop?
First you should get the size of your desktop by using sysinfo.ocx control object.
Then dynamically adjust your window (.width + .left) to not exceed sysinfo.WorkAreaWidth / Screen.TwipsPerPixelX and
(.top + .height) <= .WorkAreaHeight / Screen.TwipsPerPixelY
hehehe nag libog na noon....to be simple u can trap the dimensions of your form through the resize event of the form just like in vb6 you will have to set its width and height to scale width and scale height on the resize eventOriginally Posted by DeathFox
Use rectangle Clipbounding...
This object:
My.Computer.Screen.WorkingArea
When you resize or move your form, just get its location(X,Y)/Size and compare it with the WorkingArea. If mu sobra na sa WorkingArea or ang size sa form is more than the WorkingArea then disallow moving/resizing your form.
Similar Threads |
|