We help IT Professionals succeed at work.

Opening an VBP file

ahelgeson
ahelgeson asked
on
I'm trying to solve an irritating problem:
When I double click on a .VBP file (My Project) It loads it into VB and then sits there on a blank screen.

From this point on, I have to open the "Forms" folder within the project window and then double click on the Form that I want to modify.

My Question:
Is there any way to have VB automatically open the default form when I open the project so I don't have to navigate to this form manually?
Comment
Watch Question

as far as I am aware, there is no "Default" form in a VBP.  There is a Start-up form, but that is the form for the executing application to start with, and rarely would that necessarily be considered a "Default" form.

In my installation of VB, when I double click on a VBP file, it opens with the configuration of code screens as I left it when I last closed the IDE.  But I am not aware of any way to have a specific form be shown as the "default" - displayed at the "front" of the IDE.

Author

Commented:
When I say "Default Form" I mean the startup form.  I know this can be done because for some reason I have 1 project that opens to the startup form automatically. I don't know how I did it, but I want to do the same thing on other projects as well.
Commented:
when you hit the x to close the ide if when it asks you to save a few files say yes.  then whatever file had focus when you close will have focus when you open the ide again.
the startup form only is relevant when the application is executing.  I don't think that there is anything that allows that to be the form which is displayed "automatically" in the IDE, other that the fact that that was the last form that you accessed (displayed) prior to closing that project the last time it was opened.  There is no setting of the VB IDE which will do that automatically.

Commented:
Also if you save the file after hitting the x when you open it up again it will show the source of the file you closed not the form. from that point hit the view object button.
CERTIFIED EXPERT
Top Expert 2012

Commented:
What you are looking for is in the VBW file.  This saves the position of each of the windows (form(s), module(s), class(es), etc) open in the IDE when you exit regardless of whether you save the project.

Anthony

Commented:
This information about what to display where next time the project opens is stored in the VBW file (at least for VB6). This is what you can do, Open Notepad, type the foillowing on a line --
frmInitial = 0, 0, 0, 0, , 0, 0, 0, 0, C (assuming frmInitial is the form of interest)
press enter, then save as <projectname>.VBW (if the file is there, replace it) in the same folder as VBP.

Other folks are right, whatever you leave behind as open when you close the project, you will get back to those windows when you re-open the VBP (if you look into the VBW file when you start playing around, you will see various entries in the VBW file to give you more insight !). HTH.

Commented:
If your VB isn't opening the projects the same way that you are saving them when you close the project, you might consider a simple reinstallation of VB.

hth.

Wileecoy.

Commented:
>I have to open the "Forms" folder within the project window and then double click on the Form

You can avoid the first step (open the "Forms" folder) - click on 'Toggle Folders' button in Project explorer...

Name your first form afrmMain and it will be at the start of the tree.

>whatever you leave behind as open when you close the project, you will get back to those windows when you re-open

You can make .Vbw file read-only and avoid this feature.

Commented:
If code window of your form is opened, press Shift+F7 to view form.

Author

Commented:
I can't believe I didn't figure this out on my own. Thanks for everyone's suggestions!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.