New to VB, Help please?

Associate
Joined
9 Jul 2004
Posts
663
Location
Rotherham
Im making a small program for me and a few friends that automates the process of installing custom car files in Trackmania nations. Ive got the program to work so far and have installed a car using it but you have to type in the path of the car file manually. Is there a way to have a browse button instead of an inputbox?

Code:
strSource = InputBox("Enter the cars .zip file location")

^Is there a way to change that somehow so the user can press broswe and point to the file?

Only had 2 lessons on VB at college so go easy on me

Also, im using VB6, is there anyway to compile the program into a single .exe, a bit like Coretemp for example?

Thanks, Ben
 
Last edited:
Been awhile since ive done VB6.

First you need to add the common dialog contols to your project

right click your toolbox and click components, select "Microsoft Common Dialog Controls"

Add this control to your project.

Filter sets the file extention in ie
CommonDialog1.Filter = "Doc File|*.doc"

FilterIndex sets the default filter ie
CommonDialog1.FilterIndex = 0

ShowOpen opens the dialog box ie
CommonDialog1.ShowOpen

Filename gives you the file name ie
astr = CommonDialog1.Filename
 
There's a 'Make (projectname).exe' option on the file menu.

Remember you will need to package the comdlg32.ocx as well as any other library's you have used with the exe for it to work. After you have compiled have a look at the package and deployment wizard app to create a install package.
 
Dont use that god awful language! Anything but VB!

May I ask why? Sure, for large projects with strict requirements for memory management, threading etc, then it's not much use, but for something quick & simple like an application to move a few files around - why not use VB6?
 
May I ask why? Sure, for large projects with strict requirements for memory management, threading etc, then it's not much use, but for something quick & simple like an application to move a few files around - why not use VB6?

TBH i wouldn't use VB6 for any new project, i would use .NET. No point using a 10 year old compiler.

You can even get free express versions of .NET no real point using vb6 anymore.
 
TBH i wouldn't use VB6 for any new project, i would use .NET. No point using a 10 year old compiler.

You can even get free express versions of .NET no real point using vb6 anymore.

Agreed, I can't believe colleges are still teaching VB6.
 
Back
Top Bottom