Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Eric den Doop
  Where is Eric den Doop?
 Houten
 Netherlands
 Eric den Doop
 To: Jefferson Aguilar
  Where is Jefferson Aguilar?
 Cabanatuan
 Philippines
 Jefferson Aguilar
 Tags
Subject: RE: sirs of foxpro, dragging form help,pls???
Thread ID: 50644 Message ID: 50664 # Views: 2 # Ratings: 0
Version: Visual FoxPro 8 Category: Other
Date: Saturday, September 04, 2004 11:18:31 AM         
   


> good day foxpro masters...
>
> I have a problem of dragging an object..
> I created a form with TitleBar set to 0 (No titlebar).
> The fake titlebar i made was a rectangular shape control..
> I don't know how would it act like a real titlebar...
> Just like when you drag it into one position to the other...
> Please NOTE that the ShowWindow Property has been set to 2...
>

This sample should give you an idea.
LOCAL loProjectManager
loProjectManager = CREATEOBJECT("main")
loProjectManager.SHOW(1)

DEFINE CLASS MAIN AS FORMSET
	NAME = "main"
	ADD OBJECT frmmain AS FORM WITH ;
		TOP = 0, ;
		LEFT = 0, ;
		HEIGHT = 288, ;
		WIDTH = 282, ;
		DOCREATE = .T., ;
		CAPTION = "Form1", ;
		TITLEBAR = 0, ;
		NAME = "frmmain"
	ADD OBJECT frmtitlebar AS TITLEBAR WITH ;
		DOCREATE = .T., ;
		CAPTION = "", ;
		NAME = "frmtitlebar", ;
		Label1.NAME = "Label1", ;
		Command1.NAME = "Command1"
	PROCEDURE frmmain.RESIZE
		THIS.list1.WIDTH = THIS.WIDTH - (THIS.list1.LEFT * 2)
		THIS.list1.HEIGHT = THIS.HEIGHT - (THIS.list1.TOP * 2)
		THISFORMSET.frmtitlebar.TOP = THIS.TOP - THISFORMSET.frmtitlebar.HEIGHT
	ENDPROC
	PROCEDURE frmmain.INIT
		THIS.MINHEIGHT = THIS.HEIGHT
		THIS.MINWIDTH = THIS.WIDTH
		THIS.ADDOBJECT("List1", "Listbox")
		WITH THIS.list1
			.LEFT = 8
			.TOP = 8
			.WIDTH = THIS.WIDTH - 16
			.HEIGHT = THIS.HEIGHT - 16
			.VISIBLE = .T.
		ENDWITH
	ENDPROC
ENDDEFINE
DEFINE CLASS TITLEBAR AS FORM
	HEIGHT = 29
	WIDTH = 226
	DOCREATE = .T.
	AUTOCENTER = .T.
	BORDERSTYLE = 0
	CAPTION = ""
	TITLEBAR = 0
	BACKCOLOR = RGB(0,64,128)
	NAME = "titlebar"
	ADD OBJECT Label1 AS LABEL WITH ;
		BACKSTYLE = 0, ;
		CAPTION = "Classes", ;
		HEIGHT = 17, ;
		LEFT = 8, ;
		TOP = 6, ;
		WIDTH = 57, ;
		FORECOLOR = RGB(255,255,255), ;
		NAME = "Label1"
	ADD OBJECT Command1 AS COMMANDBUTTON WITH ;
		TOP = 6, ;
		LEFT = 198, ;
		HEIGHT = 17, ;
		WIDTH = 16, ;
		FONTBOLD = .T., ;
		CAPTION = "X", ;
		NAME = "Command1"
	PROCEDURE INIT
		THIS.MOVED
	ENDPROC
	PROCEDURE MOUSEDOWN
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		DO WHILE MDOWN()
			THIS.MOVE(MCOL("",3) - nXCoord, MROW("",3) - nYCoord)
		ENDDO
	ENDPROC
	PROCEDURE MOVED
		THISFORMSET.frmmain.TOP = THIS.TOP + THIS.HEIGHT
		THISFORMSET.frmmain.LEFT = THIS.LEFT
	ENDPROC
	PROCEDURE Label1.MOUSEDOWN
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		THIS.PARENT.MOUSEDOWN(nButton, nShift, nXCoord, nYCoord)
	ENDPROC
	PROCEDURE Command1.CLICK
		THISFORMSET.RELEASE
	ENDPROC
ENDDEFINE

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts

ENTIRE THREAD

sirs of foxpro, dragging form help,pls??? Posted by Jefferson Aguilar @ 9/4/2004 8:19:25 AM
RE: sirs of foxpro, dragging form help,pls??? Posted by Eric den Doop @ 9/4/2004 11:18:31 AM
RE: sirs of foxpro, dragging form help,pls??? Posted by Jefferson Aguilar @ 9/6/2004 8:15:43 AM
RE: sirs of foxpro, dragging form help,pls??? Posted by Boudewijn Lutgerink @ 9/6/2004 9:38:49 AM
RE: sirs of foxpro, dragging form help,pls??? Posted by Jefferson Aguilar @ 9/9/2004 4:19:28 AM
RE: sirs of foxpro, dragging form help,pls??? Posted by xtian nojimas @ 9/9/2004 5:13:30 AM
RE: sirs of foxpro, dragging form help,pls??? Posted by Jefferson Aguilar @ 9/10/2004 5:43:41 AM