[英]Access a ListView located in a UserControl from the MainForm in Winforms
[英]Removing Border from WinForms UserControl
我有帶有黑色邊框的 UserControl。 我想刪除邊框或更改其顏色。
.
找到解決方案,但它沒有刪除邊框:
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();
}
}
控制來自這個項目。
更新:我正在嘗試繪制新邊框。 在TreeListView
class 的OnPaint
方法末尾添加了這些代碼行:
Rectangle rect = base.ClientRectangle;
ControlPaint.DrawBorder(e.Graphics, rect, Color.DarkBlue, ButtonBorderStyle.Solid);
然而,垂直滾動條畫在我的邊框上。 如何解決這個問題? 還在FolderViewTree
中嘗試了相同的代碼,但滾動條將邊框推向左側(我希望在邊框內有滾動條,因為它原來是這樣)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.