Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Underline Extending too far on Label
Message
From
12/04/2004 14:25:03
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00894032
Message ID:
00894174
Views:
10
Hey Sergey,

Very strange... I was using
= TableAlias.FieldName
in the label caption and simply by using
= (ALLTRIM(TableAlias.FieldName))
it works fine. Even though the data in the table is already trimmed. Ok, I don't understand the why of it, but either way thanks!


>Hi Jay,
>
>I don't see it in VFP8SP1. Here's my test code.
PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>*
>DEFINE CLASS form1 AS form
>
>
>	Top = 0
>	Left = 0
>	Height = 285
>	Width = 482
>	DoCreate = .T.
>	Caption = "Form1"
>	MaxHeight = 1024
>	Name = "Form1"
>
>	ADD OBJECT label1 AS label WITH ;
>		FontUnderline = .T., ;
>		Caption = (ALLTRIM(Products.eng_name)), ;
>		Height = 17, ;
>		Left = 97, ;
>		Top = 36, ;
>		Width = 288, ;
>		ForeColor = RGB(0,0,255), ;
>		Name = "Label1"
>
>	ADD OBJECT command1 AS commandbutton WITH ;
>		Top = 173, ;
>		Left = 307, ;
>		Height = 27, ;
>		Width = 84, ;
>		Caption = "Next", ;
>		Name = "Command1"
>
>	ADD OBJECT command2 AS commandbutton WITH ;
>		Top = 173, ;
>		Left = 91, ;
>		Height = 27, ;
>		Width = 84, ;
>		Caption = "Prev", ;
>		Name = "Command2"
>
>	PROCEDURE Load
>		CLOSE DATA
>		OPEN DATABASE (HOME(2) + "\data\testdata")
>		USE Products
>	ENDPROC
>	PROCEDURE command1.Click
>		SKIP IN Products
>		Thisform.label1.Caption = ALLTRIM(Products.eng_name)
>	ENDPROC
>	PROCEDURE command2.Click
>		SKIP -1 IN Products
>		Thisform.label1.Caption = ALLTRIM(Products.eng_name)
>	ENDPROC
>ENDDEFINE
>
>
>
>>I'm using a label to display the value of a field. I have it formatted to look like a hyperlink (a real one, not the silly looking button in the toolbar) and the problem is that the underline extends beyond the displayed text. The text is trimmed and I have tried using AutoSize, etc. but it always extends beyond the right end if the length of the text is less than the actual field length in the table. It seems to depend on the number of characters in the text. If I use text that fills the entire field it displays correctly. If not, then there is extra underline. Any ideas?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform