Today i started my very first experiments with the new MBS Scintilla Plugin. I hope i can use it as a replacement for the DesktopTextArea. We have in my App a Window which is used for Plain Text, Markdown Code and HTML “Code”.
I hope i can make it look, like just any other DesktopTextArea. But i am already struggeling while trying to remove the Line Numbering on the left Side and setting the Font, Font Size and so on.
Since you and the project site have extensive documentation, I’m making good progress. All I’m missing now is a really simple description of how I can create my very own style definition.
Let’s assume that I want Scintilla to behave like a simple TextArea that marks entire words enclosed in < and > in red and bold. However, everything else in Scintilla should be displayed 1:1 as plain text. Are there a few instructions with which I could define this, for example in the Open Event?
Until I find the time to write something sophisticated and secure, I’ll use a modified version of one of your StyleNeeded examples for my tests:
#Pragma BackgroundTasks False
Dim startPos As Integer = Me.EndStyled
Dim lineNumber As Integer = Me.LineFromPosition(startPos)
Dim LineStartPos As Integer = Me.PositionFromLine(lineNumber)
Dim t As String = Me.Text
Dim pos As Integer = LineStartPos
Dim doStyle As Boolean = False
While pos < position
Var ch As String = t.Middle(pos, 1)
If ch = "<" Then doStyle = True
If doStyle Then Me.SetStyling(pos, 1, Me.Style(2))
If ch = ">" Then doStyle = False
pos = pos + 1
Wend
Hello @Christian_Schmitz. Is there something like a VerticalScrollPosition (like in the Xojo TextArea) function in the Scintilla plugin? Can’t find anything like that. Thank you.