iT邦幫忙

0

vs2019 c#編輯器 Windows Forms 表單設計模式下的問題??

vs2019 c#編輯器 Windows Forms的問題??
弄了一個 Windows Forms 專案 做練習??
裏頭有三個form,form裡面是簡單的幾個按鈕...

https://ithelp.ithome.com.tw/upload/images/20210424/200132949VVOeBUwwu.jpg

不知道為何 form2.xxxx設計模式 ...滑鼠點兩下竟然點不開(上圖form1.xxx設計模式 可以開啟)

我確認過 沒有任何bug!!編譯程式碼 能正常運作!!

目前想到是 就是砍掉 再重練??

看更多先前的討論...收起先前的討論...
PPTaiwan iT邦新手 2 級 ‧ 2021-04-25 09:23:15 檢舉
你在新增 Form2 時是不是選錯了?? 選擇到 "類別" 了,砍掉再重新選擇 表單(Windows Forms) 應該就可以了。
我是 選 表單的..而且原來是可以編輯的...
因為這已經好幾次了??所以上來發問
出現這個錯誤
The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: The class Form2 can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again.





Instances of this error (1)

1. Hide Call Stack

於 Microsoft.VisualStudio.WinForms.RemoteClient.Loader.RemoteCodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
於 Microsoft.VisualStudio.WinForms.RemoteClient.Loader.RemoteCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
於 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
--- 先前擲回例外狀況之位置中的堆疊追蹤結尾 ---
於 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
於 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
改好了!!!原來是 public class 類別 放的位置不對

尚未有邦友回答

立即登入回答