表单代码为空,但项目编译并显示GUI [英] Form code is empty but the project compiles and the GUI is shown
问题描述
我有一个只有一种形式的项目,即 Form1.vb 。
当我双击这个文件来编辑带有工具箱的控件时,文件被打开,但是它是空的。
奇怪的是,当我编译和运行这个项目时,我在这个文件(Form1.vb)中创建的图形用户界面显示出来就像它那样,但正如我所说的,该文件是空的,所以我不能编辑GUI。
我该如何修复它?
问题的屏幕截图:
如果您需要,项目文件夹的屏幕截图:
已解决。
我无法获取Form1.vb的代码,但我创建了一个新表单并将Form1.Designer.vb的代码复制到新窗体的窗体设计器文件中(该文件位于我的文件夹中,并且由于该窗体的GUI在编译和运行项目时显示)。为了做到这一点,我使用文本编辑器打开了文件。
它允许我编辑现有的GUI,保留我创建的控制项的属性。
I have a project that has only one form, that is Form1.vb.
When I double click this file to edit the controls with the toolbox, the file is opened, but it is empty.
The strange thing is that when I compile and run the project, the GUI that I had created in this file (Form1.vb) is shown like it whas there, but as I said, the file is empty, so I can't edit the GUI.
How can I fix it?
A screenshot of the problem:
For if you need, a screenshot of the project folder:
Solved.
I can't get the code of Form1.vb, but I created a new form and copy the code of Form1.Designer.vb (this file was in my folder, and due to it the GUI was shown when I compile & run the project) to the form designer file of the new form. To did it, I opened the file with a text editor.
It allowed me to edit the existing GUI preserving the properties of the controlls that I had created.
这篇关于表单代码为空,但项目编译并显示GUI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!