Text expansion
Posted
#1
(In Topic #1406)
Guru

This code shows the issue: -
Code (gambas)
- LCDLabel1 As LCDLabel
- .Text = "Resize me"
- .Arrangement = Arrange.Horizontal
- .H = 150
- .W = 150
- .Padding = 5
- .Alignment = Align.Center
- .Text = "W"
- .Text = "W"
Posted
Guru

must be some workarounds though
this works on your above example (and if using different text/words)…
Code (gambas)
- ' if label text height and width are less than the label size then increase Font.Size
- ' if label text height or width is more than the label size then decrease Font.Size
you could also probably use a PictureBox and paint the text to a picture then have the PictureBox.Stretch enabled to make it fit.
Posted
Guru

Posted
Guru

Then any label who's name is like "SLabel*" gets stretched.
Code (gambas)
- With Lbl
- ' if label text height or width is less than the label size then increase Font.Size
- ' if label text height or width is more than the label size then decrease Font.Size
Could be easier than converting all into pictureboxes
If naming is like Label1 , Label2, etc you just add S to the start of the Label names you want to stretch.
Posted
Guru

Code (gambas)
- BuildForm
- SetAllLCDsGray
- byMin = byMin - byRemainder
- ShowText(byIt)
- ShowText(byIs)
- byHour = byHour - 12
- bPM = True
- ShowText(byHr[byHour])
- 'ShowText(byPM)
- 'ShowText(byAM)
- 'Oclock, Five, Ten, Quarter,Twenty, Twentyfive, Half , Twentyfive, Twenty,Quarter, Ten, Five
- ShowText(byTo)
- ShowText(byPast)
- ShowText(byPoints[byMin / 5])
- MinPanels[byMin].Background = Color.Blue
- Me.Refresh
- lLCDs[byLoop + byCount].Foreground = Color.Red 'Settings["Foreground", Color.Red]
- lLCDs[byLoop + byCount].Background = Color.Yellow 'Settings["Background", Color.Yellow]
- lLCDs[byLoop + byCount].HighlightColor = Color.Yellow 'Settings["Highlight", Color.Yellow]
- lLCDs[byLoop].Foreground = Color.LightGray 'Settings["FaintForeground", Color.LightGray]
- .Arrangement = Arrange.Vertical
- .Padding = 5
- .Height = 512
- .Width = 512
- .Background = Color.cyan
- .H = 28
- .Padding = 5
- .Alignment = Align.Center
- .Text = sLetters[byRow][byCol]
- .Foreground = Color.LightGray
- lLCDs.Add(LCDLabel1)
- .H = 24
- .Padding = 3
- .W = HBox2.H - (HBox2.Padding * 2)
- MinPanels.Add(Panel1)
- .Delay = 1000 ' Not sure!
- .Trigger
- .Start
1 guest and 0 members have just viewed this.



