ScintillaNET
ScintillaNET copied to clipboard
Get total count of columns and get/set the first visible column
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!
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;
}
}