Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Property for text controls that is like tooltiptext???
Message
From
20/07/2022 05:55:05
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01684667
Message ID:
01684679
Views:
51
>>So, it works like AUTOSIZE = .t.? Is this bound to a field or just static? Bound to a field would be of interest how it traces recordchange ...
>
>Lutz, to be perfectly honest I don't know what kind of control it is. The code I work on is incredibly dense. It's definitely something they've brewed up in VFP and perfected. Maybe it's a listbox that grows with the length of the text. It's actually quite an amazing codebase. I've never seen anything like it before.

There's some code in https://www.levelextreme.com/Home/ShowHeader?Activator=17&ID=9445 (alert.prg) where the first parameter (text of arbitrary length) is chopped into parts (using memlines() and mline()) and then lining up labels, one per part.
nLines=Memlines(_msg)
msg_wid=1
_Mline=0
oAlert.FontBold=.T.
Do While _Mline<Len(_msg)
	msg_wid=Max(msg_wid, oAlert.TextWidth(Mline(_msg,1,_Mline)))
Enddo
msg_wid=Max(msg_wid+20, oAlert.oDugmad.Width)  && this is for calculating the form's width, oDugmad is buttons

_Mline=0
oAlert.AddObject("oMsg","msg", nLines)   && oMsg is a container, with an array of label objects, named oMsg.Box
With oAlert.oMsg
	For i=1 To nLines
		With .Box[i]
			.Caption=Mline(_msg,1,_Mline)
			.FontSize=g_fontsize
			.FontName=g_fontname
			.FontBold=.T.
			.Height=Fontmetric(2,g_fontname,g_fontsize)+Fontmetric(3,g_fontname,g_fontsize)
			.Top=(i-1)*(.Height+2)
			.Left=0
			.Visible=.T.
			.BackStyle=0
			.Width=msg_wid
			.Alignment=2	&& centered
		Endwith
	Endfor
Various positional properties here serve just the layout of the form; the OP would probably align them differently, to suit his purpose.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform