Le 15/01/2014 01:44, Bruce a écrit :
> I can't work out how to do this.
>
> I have an Editor control with a form definition (xyz.form) in it, I am
> trying to search for the definition of, say, a toolbar called
> "tbrProjectEdit" which starts at line 220.  This is initiated by a
> double click on a gridview on the "Toolbars" tab in the screenshot.
>
> Public Sub gvwToolbars_Activate()
>
>    Dim sKey As String = gvwToolbars[gvwToolbars.Row,
> gvwToolbars.Column].Text
>    Dim iLine As Integer
>
>    ...
>
>    If gvwToolbars.Column = 1 Then
>      iLine = edtFormDef.FindNextWord(skey, 0)      <-- 1
>      edtFormDef.Select(iLine, 0, iLine, 999)       <-- 2
>      edtFormDef.CurrentLine = iLine                <-- 3
>      ' edtFormDef.Lines[iline].Expanded = True
>      ' edtFormDef.Scroll(edtFormDef.ToPosX(0, iLine), 0)
>      edtFormDef.SetFocus
>      TabStrip1.Index = 0
>    Endif
>
> End
>
> 1) Finds the line fine.
> 2) Sets the selection fine.
> 3) and the next two lines are my attempts at making that line visible in
> the editor. To no avail.  It just remains at the top of the text.
> But, if I just adjust the size of the form a touch, the editor is
> redisplayed exactly where I want it, as in the 2nd screenshot.
>
> What am I missing?
>
> tia
> Bruce
>

The CurrentLine is for highlighting the current line of code during a 
debugging session.

Use the Editor.Goto() method instead.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to