I’m working on a new Web App and I need the WebTextField height to be larger than the default 38 and with a larger font size. I’ve tried the following in both the Opening and Shown events and the only part that works is the color.
Var Style As New WebStyle
Style.FontSize = 24
Style.BackgroundColor = LightYellow
Style.BorderColor = LightYellow
Me.Style = Style
Me.Height = 80
Is there some other way to do this that isn’t broken?
OK. So I may have to switch to GrafittiTextField to capture the enter key because WebTextField doesn’t have a Keydown event, (boo!), and GreafittiTextField has an EnterPressed event that I can use. However the same formatting that works in a WebTextField fails on a GreafittiTextField except for the “font-size”. Screen Capture below WebTextField is on the left.
@Anthony_G_Cyphers may be able to guide me and I filed a support ticket with him, but I may not hear from him today. Does anyone else know how to do this with GrafittiTextField? Anthony’s docs are too sparse to sort it out. Everything I’ve tried gives me errors.
It is a shame that Xojo is not RAD anymore, you have to learn CSS if you want to work with the styles.
But since xojo is suposed to use a css framework, it should use the classes from such framework istead of styles, but xojo don expose methods to use those classes
To have a bigger field with bold text, a code like this could be used:
Dim JS As String = "document.getElementById('" + TextField1.ControlID + "_field').classList.add('font-weight-bold', 'form-control-lg', 'text-center');"
Me.ExecuteJavaScript(JS)
Exept that it this code fails in the Opening event
But you can use it once the page is fully loaded (if you dont care that the styles change while the user is looking)