B4J Question Modal form with scrollable text

bdunkleysmith

Active Member
Licensed User
Longtime User
I have created a modal form for use as a simple help screen for my app and currently display the text as a label with the following code.

B4X:
'Class module
Sub Class_Globals
    Private fx As JFX
    Private frm As Form
    Private helpTxt As Label
    Private closeButton As Button
End Sub

Public Sub Initialize (Parent As Form)
    frm.Initialize("frm", 600dip, 750dip)
    frm.Title = " LiveStats Analysis V4.6 - Help"
    frm.Icon = fx.LoadImage(File.DirAssets,"IMG_41.gif")
    frm.RootPane.LoadLayout("LiveStatsHelpV1")
    frm.SetOwner(Parent)   
End Sub

Public Sub Show As Paint
    helpTxt.text = "Navigate to the game of interest using the browser at the bottom of the screen to open the LiveStats boxscore" & CRLF & CRLF
    helpTxt.text = helpTxt.text & "When the 'Get Data' button is activated, click on it to download the game data. When the data download is complete, the 'Analyse', 'Boxscore' or 'PlayByPlay' buttons will be activated. Clicking on either will result in the following:" & CRLF & CRLF
    helpTxt.text = helpTxt.text & "Comments, suggestions and bug reports may be sent to Bryon Dunkley-Smith at bdunkley-smith@bigpond.com."
    frm.ShowAndWait
End Sub

Sub closeButton_MouseClicked (EventData As MouseEvent)
    frm.Close
End Sub

I don't just want to keep making the anchor pane larger as I add more text, but would like it to be scrollable, however I can't find a suitable method.

Thanks in anticipation of suggestions.
 

bdunkleysmith

Active Member
Licensed User
Longtime User
OK, I've taken the first option, but how do I change the background color of the ScrollPane from (the default?) grey?
 
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

you might consider to use a webview in which you can use HTML Tags. See attached example for a simple message form.

Examples calling the sub form:
B4X:
' Declare
Dim msg As FormMsg
' Init the message form
msg.Initialize
' Show
msg.Show("About...", "<H1>My App</H1><HR>Version 1.0")
 

Attachments

  • formmsg.zip
    1.6 KB · Views: 332
Upvote 0
Top