Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to move a form with child object (fake titlebar)
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
How to move a form with child object (fake titlebar)
Divers
Thread ID:
01127226
Message ID:
01127226
Vues:
72
Hi,

I found the thread about moving a form with no title bar. The code works fine as long as you want to move the form by clicking on a non-object. What I want to do is make a fake title bar and drag/move the form from that. To reproduce what I'm talking about, create a form with an image object and command button.
Form.TitleBar=0

Form.Load()
-----------
DECLARE INTEGER ReleaseCapture IN WIN32API
DECLARE INTEGER SendMessage IN WIN32API INTEGER, INTEGER, INTEGER, INTEGER

Form.MouseDown()
----------------
LPARAMETERS nButton, nShift, nXCoord, nYCoord
LOCAL lnHandle

IF nButton = 1
	ReleaseCapture()
	SendMessage(ThisForm.HWnd,0x112,0xF012,0)
ENDIF

CommandButton.Click()
---------------------
ThisForm.Release()
So now you have a form that you can drag from anywhere except the image box or command button. If I copy the code from the Form.MouseDown() to the Image.MouseDown(), I should be able also drag from the image button, but it doesn't work right. You can drag the form from the image box, but then need to click again anywhere in the form to 'clear' the initial MouseDown() action so that you can drag again. So to drag by my fake titlebar, it only works 50% of the time - or more to the point, every other time.

I've done more experimenting with it, but before I get too long of a post and people just skip this, I was hoping someone knows of this problem and a solution. If not, I can post what I've tried with DODEFAULT() NODEFAULT and MouseUp test and give more observations.

Thanks in advance.
Michael Piehl
Locutus Software Inc.
landogarner@other-land.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform