Menu

#15 Possibility to always show the scrollbars.

open
nobody
None
5
2010-10-27
2010-10-27
No

Hello, for our client, we needed the possibility to always show the scrollbars. I hope you can add this to the next release, so I can use it without changing the treeview code. The fix I used was the following:

1) Added a public bool to the TreeViewAdv:
/// <summary>
/// Always show the scrollbars, even if they are not needed.
/// </summary>
public bool AlwaysShowScrollbars { get; set; }

2) Change the UpdateHScrollBar function by changing the following line:
_hScrollBar.Visible = AlwaysShowScrollbars || (_hScrollBar.LargeChange < _hScrollBar.Maximum);

3) Change the UpdateHScrollBar function by adding the following line at the end:
_hScrollBar.Enabled = _hScrollBar.LargeChange < _hScrollBar.Maximum;

4) Change the UpdateVScrollBar function by changing the following line:
_vScrollBar.Visible = AlwaysShowScrollbars || ((RowCount > 0) && (_vScrollBar.LargeChange <= _vScrollBar.Maximum));

5) Change the UpdateVScrollBar function by adding the following line at the end:
_vScrollBar.Enabled = (RowCount > 0) && (_vScrollBar.LargeChange <= _vScrollBar.Maximum);

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.