开发者

To Switch To The Design View Of A Windows Form

开发者 https://www.devze.com 2023-02-01 05:34 出处:网络
I create new project in Windows Form Application using Visual Studio in VB.Net. I place some controls on my form.

I create new project in Windows Form Application using Visual Studio in VB.Net. I place some controls on my form. I don't write any code at this time. I close this project. When i open this project again , i fo开发者_如何学Pythonund Form1.vb. I double-click that file , but the design view doesn't appear. I also find Form1.Designer.vb. What in this file is code. How can i switch to Design View of Form1 ? I need to write some codes for that form's objects like Button Click Event.

June


Use F7 button to toggle between Design View and Code View.


You should not edit Form1.Designer.vb file. And be sure there is at least the following lines exist.

Public Class Form1

End Class

Tun Zarni Kyaw


(Here, I am taking your Form as f1)

To view the design, just go like - View>Solution Explorer>f1 (double click on f1 to open its design).


Click the button in Solution Explorer - Folder View to "Switch between solutions and available views" and then click on the form file.


F7 to toggle from design mode to code Shift + F7 to toggle back to design mode


I realized the issue appears (at least for me) when there are multiple classes defined inside the .vb file.

To solve the issue you have to make sure the Form class is the first (right after the imports). Move any other class definition below this class and forms designer will become available again.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号