2015-04-28 97 views
0

在添加控件來形成時,突然間所有的元素都丟失了邊框,灰色的內部光澤陰影就是最好的例子,複選框和單選按鈕都有。C#Windows窗體控件丟失邊框?

那些現在看起來是這樣的:enter image description here

取而代之的是這樣的:enter image description here

我無法找到一個解決辦法呢。我應該更改哪些屬性以獲得所需的樣式?謝謝!

回答

3

也許你已經從你的主要方法中刪除了Application.EnableVisualStyles();

[STAThread] 
    static void Main() 
    { 
     Application.EnableVisualStyles(); // Did you remove this line? 
     Application.SetCompatibleTextRenderingDefault(false); 
     Application.Run(new Form1()); 
    } 
+0

當我從.dll開始創建一個線程表單時,我甚至沒有這一行。現在添加並解決了這個問題。非常感謝! – user2818626