Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default Forms

Status
Not open for further replies.

Kazim

Programmer
Jul 23, 2001
26
0
0
GB
It might seem a daft question but....

When you add a form to a project you are presented with the default form. I want to cut down on the number of things that I automatically edit by customizing the default form some that it opens to my own specification.

I have done this with a new project, so that the first form and the control set is as I want them, but I want to do the same for the default form that is added during a project.

Problem is that I cant find the default form file anywhere, and I'm wondering if it is generated on the fly by VB. If so is there a data file somewhere that can be edited?

Any help would be much appreciated

Kazim

PS: Happy Christmas if you celebrate it!
 
Hi Kazim:

A little exploration reveals that VB stores its templates in

C:\Program Files\Microsoft Visual Studio\VB98\Templates

I would like to suggest looking at the FRM files in Forms, MDIForms, Projects -- all under the above directory.

A good first step is to save a copy of the originals, just in case one makes a serious mistake and needs to restore the original.

Cassandra
 
Yep! Already been there and none of them seem to be the right one. This is where I created my own project startup sets, but the single default form that gets created when you add a form to an already open project does not seem to be here.

Kazim
 
Go to Tools|Options, select the Environment Tab and make sure that the Template directory (at the bottom of that Tab) shows the correct location. As Cassandra says, that is normally C:\Program Files\Microsoft Visual Studio\VB98\Template. You also need to ensure that the Show Templates for Forms checkbox on the same tab is checked.

If I save a Form to that directory, it appears in the dialog box that appears when you choose Project|Add Form. That dialog only appears if the checkbox mentioned above is checked.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
Yes I know about these settings and they are all correct. I don't want to add another form to the box, I have plenty there already, but I want to edit the default form.

When the dialog appears the selected item, by default, is the built in VB form. Thats the one I want to edit, and that particular form doesn't exist in the forms templates folder.

Cheers

Kazim
 
>that particular form doesn't exist

Correct. It is built-in and not modifiable. This is by design, stops anyone destoying the default by accident. As you already seem to be aware, and as people are advising, If you want a variant you have to create your own template - and I'm afraid that I don't know a way of changing which item is selected when the Form dialog is opened
 
Hi Kazim:

In line with Strongm's comment, it looks like that default form is created by code in VBA6.DLL in the VB98 subdirectory. The text of the default form is present in the DLL.

Cassandra
 
Okay guys thanks for that. I kind of guessed that it would be built in, but I was hoping that it would be a little more editable than with a HEX editor!

Thanks again and happy holidays

Kaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top