Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can one make a Memo field show in a grid w/o clicking?
Message
De
21/07/1998 04:59:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
21/07/1998 03:37:58
James Beerbower
James Beerbower Enterprises
Hochheim Am Main, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00114479
Message ID:
00119610
Vues:
14
>Either use mline(,1) in the control source (but then they can't edit!) Or make your field type char. Those have been the fastest solutions for me. It probably is possible to work with memo fields as edit so maybe someone else has a better suggestion.
>
>James Beerbower
>VCA SE GmbH (DE)
>Qsys Ltd (USA)
>
>>I've got a grid where the textbox was removed and an editbox put in for display of a memo field. When the grid appears, the word "memo"
>>is all that shows. Under normal operation, with a user dbl clicking on that column that's fine. But, the edit box is the only column in this grid and is sized large to display the memo contents. Any way to get the value of the memo field to show without having a user click on the edit box?
>>
>>Thanks,
>>Steve
Hi,
Having an editbox in grid with sparse .f. does the job. However it pays for a lot of rowheight and still users might need to step in box to see data. I have another solution (frankly still have some problems using in a grid), use an editbox that is just one row height and expand at right mouse click and/or when user enters for editing, viewing. It doesn't expand when not in editmode and no data. Here is class code for those interested :
**************************************************
*-- Class:        expandedit (c:\temp\test.vcx)
*-- ParentClass:  editbox
*-- BaseClass:    editbox
*-- one line expanding edit box
*
DEFINE CLASS expandedit AS editbox


	Height = 25
	Width = 145
	Name = "expandedit"

	*-- original height when got focus
	PROTECTED orgheight

	*-- original width when got focus
	PROTECTED orgwidth

	*-- Expanded height of editbox
	PROTECTED expandedheight

	*-- Expanded width of editbox
	PROTECTED expandedwidth
	nrec = .F.


	PROCEDURE Init
		with this
			.orgheight = .height
			.orgwidth  = .width
			do case
				case .parent.baseclass="Page"		&& We are in a pageframe
					.ExpandedHeight	= .parent.parent.pageheight - .top - 4
					.ExpandedWidth	= .parent.parent.pagewidth - .left - 4
				case .parent.baseclass="Column"		&& We are in a grid
					.ExpandedHeight	= .parent.parent.height - .parent.parent.headerheight ;
									- iif(.parent.parent.scrollbars%2=1,sysmetric(8),0)
					.ExpandedWidth	= .parent.parent.width
					.orgheight		= .parent.parent.rowheight
					.orgwidth		= .parent.width
					.BorderStyle	= 0
				otherwise
					.ExpandedHeight	= .parent.height - .top - 4
					.ExpandedWidth	= .parent.width - .left - 4
			endcase
		endwith
	ENDPROC


	PROCEDURE GotFocus
		WITH this
			thisform.lockscreen = .t.
			IF ( !isnull(evaluate(.controlsource)) and ;
					!empty(evaluate(.controlsource)) ) or ;
					!.readonly
				if .parent.baseclass="Column"		&& We are in a grid
					.parent.parent.rowheight = .ExpandedHeight
					.parent.width = .ExpandedWidth
				else
					.height	= .ExpandedHeight
					.width	= .ExpandedWidth
				endif
				.refresh
			ENDIF
			.zorder(0)
			thisform.lockscreen = .f.
		ENDWITH
	ENDPROC


	PROCEDURE LostFocus
		with this
			if .parent.baseclass="Column"		&& We are in a grid
				.parent.parent.rowheight	= .OrgHeight
				.parent.width				= .OrgWidth
			else
				.height = .orgheight
				.width  = .orgwidth
			endif
			.refresh
		endwith
	ENDPROC


	PROCEDURE RightClick
		keyboard "{TAB}"
	ENDPROC


ENDDEFINE
*
*-- EndDefine: expandedit
**************************************************
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform