DesktopTextField border bottom

Using Xojo 2025.2.1

How to get the border at the bottom if I add a DesktopTextField programmatically?

DesktopTextField added via GUI with drag’n’drop:
image

DesktopTextField added via code:
image

Dim tfTextField As New DesktopTextField
tfTextField.Password = isPassword
tfTextField.Width = widtht
fTextField.Height = 22
Me.AddControl(tfTextField)
tfTextField.Left = 184
tfTextField.Top = top
tfTextField.Name = name
tfTextField.AllowAutoDeactivate = True
tfTextField.AllowFocusRing = True
tfTextField.HasBorder = True
tfTextField.LockLeft = TruetfTextField.LockTop = True

Platform?

Ah sorry. Windows.

Move the line that sets HasBorder to above the AddControl line. You should probably set all of those before adding the control to the Window. I typically do to avoid such issues.

Great, thanks now it is working.

1 Like