Link to home
Start Free TrialLog in
Avatar of ahelgeson
ahelgesonFlag for United States of America

asked on

Opening an VBP file

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?
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

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.
Avatar of ahelgeson

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of DandL
DandL

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of DandL
DandL

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.
Avatar of Anthony Perkins
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
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.
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.
>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.
If code window of your form is opened, press Shift+F7 to view form.
I can't believe I didn't figure this out on my own. Thanks for everyone's suggestions!