Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to know if the edit box is high for one line only
Message
From
17/01/2008 10:52:05
Suhas Hegde
Dental Surgeon
Sirsi, India
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01282488
Message ID:
01282602
Views:
10
>Hi all
>
>I would like to know if the height of an editbox is just enough to fit in a row of text (like of a textbox) and not the multi-line height we are used to when using editboxes.
>
>Please advise.

hi,
here is something to play abt
PUBLIC ox
ox = CREATEOBJECT("form1")
ox.show
**************************************************
*-- Form:         form1 (c:\test\editheight.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   01/17/08 09:18:06 PM
*
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT edit1 AS editbox WITH ;
		Height = 24, ;
		Left = 36, ;
		Top = 120, ;
		Width = 132, ;
		Value = "this is 1 row", ;
		Name = "Edit1"


	ADD OBJECT label1 AS label WITH ;
		AutoSize = .F., ;
		Caption = "Fontsize", ;
		Height = 17, ;
		Left = 64, ;
		Top = 27, ;
		Width = 48, ;
		Name = "Label1"


	ADD OBJECT fntsize AS spinner WITH ;
		Height = 24, ;
		Left = 120, ;
		Top = 24, ;
		Width = 120, ;
		Name = "fntsize"


	PROCEDURE edit_height
		WITH thisform as Form
		.fontsize = .fntsize.value
		.edit1.fontsize = .fntsize.value
		.edit1.height = .TextHeight(this.edit1.value)+6
		.edit1.width = .TextWidth(this.edit1.value)+10
		ENDWITH
	ENDPROC


	PROCEDURE Init
		this.fntsize.Value = this.FontSize
		this.edit_height()
	ENDPROC


	PROCEDURE fntsize.InteractiveChange
		thisform.edit_height()
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform