Closed MaticBabnik closed 2 years ago
Use margin.Type = MarginType.Color
if you want a margin that display symbols with a specific background color. Then you can set the color with margin.BackColor = Color.Whatever;
The scrollbar color/style is determined by the operating system and cannot be changed.
Only works if mask isnt set to maskall. makes it kinda useless
@MaticBabnik You can disable Scrollbars in ScintillaNET and add own custom scrollbar controls.
Editor.VScrollBar = false;
Editor.HScrollBar = false;
Editor.UpdateUI += new System.EventHandler<ScintillaNET.UpdateUIEventArgs>(editor_UpdateUI);
vscrollBar = new MyCustomVScrollbar(); //has to be implemented, but there are also some open source projects
hscrollBar = new MyCustomHScrollbar(); //has to be implemented, but there are also some open source projects
vscrollBar.Scroll += new EventHandler(vscrollBar_OnScroll);
hscrollBar.Scroll += new EventHandler(hscrollBar_OnScroll);
private void hscrollBar_OnScroll(object sender, EventArgs e)
{
if(Editor!=null)
Editor.XOffset = hscrollBar.Value;
}
private void vscrollBar_OnScroll(object sender, EventArgs e)
{
if(Editor!=null)
Editor.FirstVisibleLine = vscrollBar.Value;
}
private void editor_UpdateUI(object sender, UpdateUIEventArgs e)
{
if ((e.Change & UpdateChange.VScroll) > 0)
{
vscrollBar.Minimum = 0;
vscrollBar.Maximum = Editor.Lines.Count;
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;
}
}
@MaticBabnik You can disable Scrollbars in ScintillaNET and add own custom scrollbar controls.
Editor.VScrollBar = false; Editor.HScrollBar = false; Editor.UpdateUI += new System.EventHandler<ScintillaNET.UpdateUIEventArgs>(editor_UpdateUI); vscrollBar = new MyCustomVScrollbar(); //has to be implemented, but there are also some open source projects hscrollBar = new MyCustomHScrollbar(); //has to be implemented, but there are also some open source projects vscrollBar.Scroll += new EventHandler(vscrollBar_OnScroll); hscrollBar.Scroll += new EventHandler(hscrollBar_OnScroll); private void hscrollBar_OnScroll(object sender, EventArgs e) { if(Editor!=null) Editor.XOffset = hscrollBar.Value; } private void vscrollBar_OnScroll(object sender, EventArgs e) { if(Editor!=null) Editor.FirstVisibleLine = vscrollBar.Value; } private void editor_UpdateUI(object sender, UpdateUIEventArgs e) { if ((e.Change & UpdateChange.VScroll) > 0) { vscrollBar.Minimum = 0; vscrollBar.Maximum = Editor.Lines.Count; 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; } }
and how do I apply this? sry if this sounds dumb and how do I change the color of these
Can't set MarginType.Symbol; back color. Also any way to make dark mode scrollbars.