Important alert: (current site time 7/16/2013 1:18:18 AM EDT)
 

winzip icon

[ a no frame movible form ]

Email
Submitted on: 1/21/2002 1:51:42 PM
By: Vblifeline  
Level: Beginner
User Rating: By 18 Users
Compatibility: VB 6.0
Views: 39834
(About the author)
 
     This code alows you to move forms that have no frams this is compadible with all windows platforms. only one api call.

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :[ a no frame movible form ]
'**************************************
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 9 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

2/10/2002 8:56:48 PMJesse McAllister

looks familiar ;)
(If this comment was disrespectful, please report it.)

 
6/28/2002 2:08:55 AMeagle4

thanx alot
(If this comment was disrespectful, please report it.)

 
7/16/2002 11:05:30 AMKeith

Works for me, thanks!
(If this comment was disrespectful, please report it.)

 
10/7/2002 5:40:17 PMEdward Catchpole

"You're ma saviour man" The Matrix
(If this comment was disrespectful, please report it.)

 
10/25/2002 9:40:11 PM

Please use proper spelling!
(If this comment was disrespectful, please report it.)

 
11/3/2002 12:03:15 AMMalav Dhalgara

great job!
(If this comment was disrespectful, please report it.)

 
11/19/2002 6:34:54 PM

Nice
(If this comment was disrespectful, please report it.)

 
12/1/2002 9:00:10 PM

What did you use to make the buttons?
(If this comment was disrespectful, please report it.)

 
12/15/2002 11:04:47 AM

Something is wrong with my computer cause the form is messed up, the image is to small, the form is too big, and the close button is way too far to the right. Can anyone help me here?
(If this comment was disrespectful, please report it.)

 
12/15/2002 11:06:32 AM

oops...sorry, forgot to put my e-mail: nebula3677@hotmail.com

E-mail me if you can help...
(If this comment was disrespectful, please report it.)

 
3/28/2003 3:08:34 PMJasonB

Nice job! Good looking dialog!
(If this comment was disrespectful, please report it.)

 
12/15/2003 6:43:14 PMJonathan Dean

There's a better way to do this, but I can't remember what it is. You just make one call and Windows takes care of all the movement. Also, in this code the conversion from pixels to twips can cause problems on computers with Large Fonts. You should always use Screen.TwipsPerPixelX and Screen.TwipsPerPixelY instead of hardcoding "15" into your program.
(If this comment was disrespectful, please report it.)

 
3/4/2004 7:47:50 AM

as an answer to the one guy asking about the buttons, he used images.

by the way, nice code. me and my friend have been using a similar code for a few years now.
(If this comment was disrespectful, please report it.)

 
3/24/2004 6:25:42 AM

thank you for it is your code
(If this comment was disrespectful, please report it.)

 
9/9/2004 2:42:37 PM

Yeah, there is definatly an easier way but i cant find it. There is a way of using just one line and you dont need to worry about where the mouse is etc. I think there is a form shaping example around (the one with the bill gates head) it uses the simple form move method
(If this comment was disrespectful, please report it.)

 
12/17/2004 9:27:35 AM

i think you have done the good job
(If this comment was disrespectful, please report it.)

 
2/1/2005 11:34:40 AM

for BEGINNER this code is almost INTERMEDIATE level.

Moving frameless form is VERY MUCH EASIER than your complicated code.

Just add this line to global:

dim xx As Single, yy As Single

AND THIS TO FORM_MOUSEMOVE:

If Button = 1 Then
Left = ((Left) / Screen.TwipsPerPixelX - (xx - x)) * Screen.TwipsPerPixelX
Top = ((Top) / Screen.TwipsPerPixelY - (yy - y)) * Screen.TwipsPerPixelY
Else
xx = x
yy = y
End If

Form Scalemode must be pixel

THAT'S IT!
(If this comment was disrespectful, please report it.)

 
8/6/2005 12:21:48 PMMickySoft

Thank you very much.
to the other that complain:
People i'm no coder .. today is the first day i coded in VBasic and i was able to extract the code from this app and use in mine!
So if i can do it and not complain why cant you ? huh ?
(If this comment was disrespectful, please report it.)

 
12/29/2005 7:25:10 PMRyan Barnes

Very helpful, just what I needed!
(If this comment was disrespectful, please report it.)

 
6/29/2006 12:12:40 AMsunil

thanks for nice code
(If this comment was disrespectful, please report it.)

 
7/15/2008 6:08:34 AMjuned

Very good job
Thank you very much and keep it up
(If this comment was disrespectful, please report it.)

 
2/19/2010 1:32:44 PMUsman

Buddy Thx alot,you solved my problem
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.