ScintillaNET icon indicating copy to clipboard operation
ScintillaNET copied to clipboard

Get total count of columns and get/set the first visible column

Open MarcellVokk opened this issue 4 years ago • 1 comments

Hi there! I just want to know how to get the total count of the columns, and how to set the first visible column! I'm creating custom scroll bars for scintilla. I had no problem with the vertical ones, but I can't find a solution for the horizontal ones! Please help!

MarcellVokk avatar May 28 '20 19:05 MarcellVokk

Hi @Vadkarika2 , I've done it with Property XOffset Example Code:

private void hscrollBar_OnScroll(object sender, EventArgs e)
{
            if(Editor!=null)
                Editor.XOffset = hscrollBar.Value;
}

private void editor_UpdateUI(object sender, UpdateUIEventArgs e)
{
if ((e.Change & UpdateChange.VScroll) > 0)
            {
                vscrollBar.Minimum = 0;
                vscrollBar.Maximum = Editor.Lines.Count;// -Editor.LinesOnScreen;
                vscrollBar.LargeChange = Editor.LinesOnScreen;
                vscrollBar.Value = Editor.FirstVisibleLine;
            }
            if ((e.Change & UpdateChange.HScroll) > 0)
            {
                hscrollBar.Minimum = 0;
                hscrollBar.Maximum = Math.Max(Editor.XOffset,Editor.ScrollWidth);

                hscrollBar.Value = Editor.XOffset;
            }
}

viebrix avatar Aug 06 '20 14:08 viebrix