I have UserControl with black border inside. I want to remove the border or change its color.
.
Found solution but it does not remove the border:
public FolderView() {
InitializeComponent();
base.BorderStyle = BorderStyle.None;
this.BorderStyle = BorderStyle.None;
}
private BorderStyle border;
public new BorderStyle BorderStyle {
get { return border; }
set {
border = value;
Invalidate();
}
}
Control is taken from this project .
UPDATE: I am trying to draw new border. Added these lines of code at the end of OnPaint
method in TreeListView
class:
Rectangle rect = base.ClientRectangle;
ControlPaint.DrawBorder(e.Graphics, rect, Color.DarkBlue, ButtonBorderStyle.Solid);
However Vertical Scrollbar is painted over my border. How to resolve this? Also tried same code in FolderViewTree
class, but scrollbar pushes border to the left (I want to have scrollbar within the border as it was originally).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.