Corrupt forms, not displaying in "startup form"? - vb.net

In properites>Application>"Startup form" combobox, in my VS VB.NET project, I see only 2 forms listed, while my application has 6 forms. Does this mean something is corrupt?
I tried to make a new project, then copy only the old vb files into this new project. But still only those two (of 6) forms show up in the "Startup form" combo box.

Well, that's pretty odd. This list is almost certainly filled from the project file, the <SubType> element should be significant. But you eliminated that possibility by recreating the project file from scratch. I can't see how a property on a form would make it disappear from the list.
One thing you could try is editing the My Project\Application.myapp file with Notepad. Copy the solution first and make sure it isn't loaded in VS. Change the <MainForm> element to one of the forms that isn't listed. Load the project and see what is shown in the project property page and if anything breaks when you compile it.

Related

vb.net adding file to existing project

Sorry to bother you with the same problem.
I use Visual Studio for my small project. I'm a newbie.
I created separate project(s) Dailycount form & LiquorCount form.
I'm trying to bring the forms from both the project (using copy and Add Existing Items in solution explorer) to a Combined Project.
But when I open the forms in Design View. I just get the Blank form. when I build the application only 1 form is generated and another one is still blank form.
Files copied are:
Dialycount.vb
Dialycount.Designer.vb
Dialycount.resx
Liquorcount.vb
Liquorcount.Designer.vb
Liquorcount.resx
Trying to find the solution to this for the last 2 weeks and it's frustrating.

Cannot set a default item in combobox in certain project

In my VB.NET solution in Visual Studio 2015 I have some projects which contains some Windows Forms items. In general I know how to programmatically set a default item in a combobox control by using ComboBox1.SelectedIndex = 0 instruction. However this instruction do not work in one of my projects and my combobox is always blank when program runs. I also cannot add programmatically new items to combobox in this project, I can do it only using Properties sidebar.
My program runs normally, Visual Studio do not see any errors, instructions which concerns my combobox are executed but don't affect it. In other projects everything works well.
Have you ever encountered something like this? Maybe I've unconsciously changed some options in this project and that's why the problem occur?
EDIT:
Problem solved. I didn't noticed that during copying some code I accidently also copied InitializeComponent() instruction. Without this duplicated initialize instruction everything is working well and I have ability to manage default value of my combobox correctly.

Where can I find old .vb form width and height?

I have some old vb.net forms (can't find out which version they were using when they made them), and I can't find the form's Width and Height in any of the files.
The forms don't have a .designer.vb file, and it's not in the .vb "Windows Form Designer generated code" section either. However, when I open the form in the design view, I can see the values perfectly in the Properties tab.
I've tried making a file search for the values independently but there are nowhere to be found.
Any suggestions or ideas?
I have googled for some time but I can't find anything that helps.
After some tests, I'm quite sure the value comes from the sizes of everything else it has inside.
The form has various Group controls that "force" the Form's size, and therefore, there's no need to stablish it manually. If I do so, the values appear as usual, but otherwise, they are not stored anywhere.

How to find a form from many forms in vb6 on a existing project

I am working on a old project of vb6 which has hundreds if forms. I am able to run the application and have to fix a runtime error in a form which pop up. I don't know the name of the form and only have visual reference. I tried using debug but It has continues SQL statements running in a loop. Any advice is appreciated.
Thanks.
Search the code for the form caption, or the labels of controls on the form, using visual studio's "find in files" or simlar function of your favourite editor.
If the caption is set in the form design, this will take you to the .frm file the form is stored in. You can open this in Notepad or another editor to get the name of the class (which is usually the same as the filename).
If the caption is set in code, you can place a breakpoint on that line. Again, this will lead you to the code which instantiates the form.

VB.NET - Duplicate existing form in FOR loop

Hey, I'm building a code editor app in VB.NET (Framework 4.0) and it opens all ".por" files into individual forms consisting of a MenuBar and TextBox (multi-line).
Currently I have 20 forms (all duplicates of the first on I designed) and if there are say 4 ".por" files in a directory, the first four will open up while the others hide.
I think it would be far more efficient by coding a new form For each item in form1's ListView...but I want the next so many to be a copy of the first form I designed since I spent a good bit on it.
Thanks in advance!
I decided to use tabs instead.
It wasn't difficult, the problem was I didn't know how to use a form I couldn't see.
By sticking to tabs and making a huge IF statement, simply making a new tab for each new file, and I'm getting used to using controls which haven't actually been created with the designer.
Just passing through a wall here...