Android Question Multiline Title in Data Entry Dialog Box

Gerardo Tenreiro

Active Member
Licensed User
Hello

I am trying to use a dialog box whose title allows multiple lines. I have tried to locate "Input.lblTitle.SingleLine" but I do not see that this option is active.
I would use separate labels above the input box.

The code I use is this:

' Nombre de la Tarjeta en BlueTooth
Private Sub Lb_Nombre_Blue_Click
Dim Input As B4XInputTemplate

Dialog.Initialize(Root)

Input.Initialize
Input.lblTitle.Text = "Nombre BlueTooth de la Puerta:" & Chr(10) & Chr(13)
Input.lblTitle.Text = Input.lblTitle.Text & "Maximo 10 Caracteres" & Chr(10) & Chr(13)
Input.lblTitle.Text = Input.lblTitle.Text & "La Tarjeta se reiniciara si acepta"

'input.ConfigureForNumbers(False, False) ' Numeros

Wait For (Dialog.ShowTemplate(Input, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Dim res As Int = Input.Text

Log(res)
End If

End Sub

and the result of the app is this:

1712081245329.png


Any suggestions on where to start.


Thank you so much
 

walterf25

Expert
Licensed User
Longtime User
Hello

I am trying to use a dialog box whose title allows multiple lines. I have tried to locate "Input.lblTitle.SingleLine" but I do not see that this option is active.
I would use separate labels above the input box.

The code I use is this:



and the result of the app is this:

View attachment 152411

Any suggestions on where to start.


Thank you so much
The reason you don't see the singleline method is because the label is defined as a B4XView, so you need to do this to have access to that method.

B4XInputTemplate:
                        Dim inp As B4XInputTemplate
                        inp.Initialize
                        inp.lblTitle.As(Label).SingleLine = False

Hope this helps.
 
Upvote 1

Gerardo Tenreiro

Active Member
Licensed User
Hello
The code works but I have to move the input box down so that the LABEL can be seen in its entirety.
Would you know how?

Thank you so much
 
Upvote 0
Top