Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 7th, 2007, 08:22 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default Moving the form from a custom made controlbox

Hi,
   Usually at the top of a form you have a titlebar and controlbox well i have made my own (very crudely :) ) and i need it to act as if it was a proper titlebar and controlbox, the main spect i'm focussing on is moving the form using it.

Cheers,
   Apocolypse


------------------------------------------------
Apocolypse2005
Always ready and waiting to be helped!
__________________
Apocolypse2005, I'm a programmer - of sorts.
 
Old July 9th, 2007, 03:59 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Use the MouseMove event in conjunction with carrying the fact that the Left Mouse button has been pressed but not released to set the form’s .Left and .Top properties.
 
Old July 10th, 2007, 07:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hey there..

try this:

Code:
ReleaseCapture
SendMessage Me.hwnd, &HA1, 2, 0
put that code in the mouse move event of your control (the one that acts as the titlebar)...

this are the def. of the apis:
Public Declare Function ReleaseCapture Lib "user32" () As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long


HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old July 11th, 2007, 04:21 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

Now that reply was a good 'un!!! yeah that really helped. Easily please me thinks!

Cheers,
       Apocolypse


------------------------------------------------
Apocolypse2005
Always ready and waiting to be helped!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for Auto-filling a pre-made Word form dan_thorman Excel VBA 0 January 25th, 2007 10:46 AM
Event handler for moving a form tericson Access VBA 1 December 11th, 2006 04:16 AM
Moving total from Subform to Main Form Shepwad Access 1 March 10th, 2006 10:57 AM
Moving vertically on a form penta Access 5 June 2nd, 2005 07:55 AM
MDI Maximized children forms without controlbox pjbcoetzer C# 1 April 13th, 2005 12:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.