it's been a while since i've last posted something in my weblog related to vfp. i have been using this code for a long time in one of my apps and have actually posted it in the forum sometime last year or maybe 2 years ago and just recently. anyways, for those who might need it here it is. some amount of work may still be required to polish this.

public oform
oform = createobject('mysplitter')
oform.show
return
define class mysplitter as form
	top = 0
	left = 0
	height = 371
	width = 373
	docreate = .t.
	caption = "form1"
	name = "form1"
	nxtwips = .f.
	nytwips = .f.
	add object edit1 as editbox with ;
		height = 62, ;
		left = 0, ;
		top = 5, ;
		width = 365, ;
		name = "edit1"
	add object edit2 as editbox with ;
		height = 285, ;
		left = 0, ;
		top = 77, ;
		width = 365, ;
		name = "edit2"
	add object shape1 as shape with ;
		top = 71, ;
		left = 0, ;
		height = 3, ;
		width = 358, ;
		mousepointer = 7, ;
		specialeffect = 0, ;
		name = "shape1"
	procedure _resize
	lparameters lnycoord
	with this
		wait window transform(lnycoord) nowait
		lnoffset = lnycoord - .edit1.height - 8
		.edit1.height = .edit1.height + lnoffset
		.shape1.top = lnycoord
		.edit2.top = lnycoord + 4
		.edit2.height = .height - (lnycoord + 8)
	endwith
	endproc
	procedure shape1.drag
	lparameters naction
	wait window transform(naction) nowait
	endproc
	procedure shape1.mousedown
	lparameters nbutton, nshift, nxcoord, nycoord
	lcmsg =  'nbutton = ' +transform(nbutton) + chr(13) +;
		'nshift = ' +transform(nshift) + chr(13) +;
		'nxcoord = ' +transform(nxcoord) + chr(13) +;
		'nycoord = ' +transform(nycoord)
	wait window lcmsg nowait
	endproc
	procedure shape1.mousemove
	lparameters nbutton, nshift, nxcoord, nycoord
	if nbutton = 1
		thisform._resize(nycoord)
	endif
	endproc
enddefine

Leave a Reply

Your email address will not be published. Required fields are marked *