want that my program, at a click of the button will do
some highlighting in the text in an editor (a component of
gambas that you can add to a form).
So, in the form_open() method, i set :
programEdit.Styles[Highlight.Normal].Color = Color.Red
programEdit.Styles[Highlight.Keyword].Color =
Color.DarkGreen
(my editor component is called programEdit)
then in the toolbutton1_click() method i set
programEdit.Highlight = Highlight.Custom
(should this not call the programEdit_highlight() method?
)
In the programEdit_highlight, I set:
Dim z_c As Integer
Dim i As Integer
Dim z As String
Dim s As String
z = programEdit.Text '(this picks up the text in the
editor)
z_c = String.Len(z)
For i = 1 To z_c
s = Mid(z, i, 1) 'pick up each character
If s = "s" Then 'i want the "s" -s to be dark green
'Message("resetting highlight")
Highlight.Add(Highlight.Keyword) 'according to the
docs, this will set the highlight of a single character ..
Highlight.State = Highlight.Keyword 'i dont know if i
needed this, but even dropping it has no effect
Else
Highlight.Add(Highlight.Normal)
Endif
Next
this should make the "s"- s dark green, and everything
else red, but i am seeing everything simply red. where did
i go wrong?
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user