Hello Community,
Please, I want my custom dialog to display text that will fit to width but i'm unsuccessful.
Below is the code i came up with and a picture of what im talking about.
The DESCRIPTION_DIALOG
Please, I want my custom dialog to display text that will fit to width but i'm unsuccessful.
Below is the code i came up with and a picture of what im talking about.
The DESCRIPTION_DIALOG
B4X:
Private Sub lblQuoteClick_Click
CreateDescriptionPanelLayout(300dip,350dip) '300,350
Wait For(Dialog.ShowCustom(DescriptionPanel, "", "", "CANCEL")) Complete (result As Int)
If result = xui.DialogResponse_Cancel Then
End If
End Sub
B4X:
Sub CreateDescriptionPanelLayout( Width As Int, Height As Int)
Dim pnl2 As B4XView=Panel2
Dim text As B4XView=pnl2.GetView(0)
Dialog.Title ="Election Quote"
DescriptionPanel = xui.CreatePanel("")
DescriptionPanel.SetLayoutAnimated(0, 0, 0, Width,Height) '400
DescriptionPanel.LoadLayout("DESCRIPTION_DIALOG")
lblDescription.Text=$""${text.Text}""$
lblOwner.Text=$" ~ ${qname} "$
Dim Height As Int=su.MeasureMultilineTextHeight(lblDescription,lblDescription.Text )+40dip'80
Dim PnlHeight As Int = Height+ 14dip '14
lblDescription.Height=su.MeasureMultilineTextHeight(lblDescription,lblDescription.Text)
lblOwner.Top=lblDescription.Height+10dip
pnlProjectD.Height=Height+lblOwner.Height+10dip
DescriptionPanel.SetLayoutanimated(0,0,0,80%x,PnlHeight+20dip)
End Sub
Last edited: