![](/img/trans.png)
[英]Visual Studio C# Winform Designer is creating strange code for control members?
[英]Creating a winform user control with no designer
如何創建沒有GUI或設計器附件的WinForms用戶控件? 一個例子就像定時器控件,它放在你的表單上,它停靠在底部,但沒有任何GUI控件?
您需要使用System.ComponentModel.Component
作為base class
。
示例:
class Class1 : System.ComponentModel.Component
{
}
創建一個繼承自System.Windows.Forms.Control的類。 這應該將圖標從正常的“類”圖標更改為解決方案資源管理器中的“組件”圖標。 如果創建一個類並繼承自TextBox或Timer,您可以看到這種效果
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.