View Poll Results: Help with Forms
- Voters
- 0. You may not vote on this poll
-
Form help
-
Form structure
-
Form template
-
Form format
-
May 28th, 2002, 03:25 PM
#1
Thread Starter
New Member
General Forms .FRMs
I am just learning the VB language. I specifically need to learn 6.0. Now I understand all the language specifics of VB. I understand the .BAS and .CLS formatts, but not the .FRM's.
I have found perty crappy documentation on VB Forms. It appears everyone wants to use a GUI. If someone can answer the following questions for me!
1) A Form encapsulates or holds what kind of code? (Event procedures?, .... ).
2) How would you create a simple form with like one button? I am interested in the event code for that object, how it needs to appear in the .FRM file, what that file needs to be named, and most importantly, HOW DOES MAIN CALL IT! Do you have to have a .BAS file with a main, and does it need to instinciate an instance of that form? Is there general constructor-deconstructor sub procedures that fit into a form?
3)Does each form need to hold only a couple specific components?
if anyone can answer and see the troubles I am having with forms, and answer them, or send me to a great tutorial, I would be very appreciative.
Thank you in advance!
-
May 28th, 2002, 03:59 PM
#2
PowerPoster
You are confusing programming languages with development environment. VB is a development environment. IT creates the FRM files from your creation, in the development environment, of controls inside a form. To create a FRM file on your own is certainly possible, but just silly, since that's what the VB development environment DOES.
The FRM file is a flat file that contains (1) information that the develoment enviornment puts there so that the compiler can turn the information into calls to windows API functions to create the controls that are described, followed by (2) the funcitons (VB code) that you write to manage what happens in the crontols.
That is, the second part of a FRM file looks exactly like a BAS file except that in addition to any user-defined functions, it also contains the event-driven funcitons for the controls.
Just use the VB environment and let it create the FRM files.
-
May 28th, 2002, 04:01 PM
#3
Hyperactive Member
Do you have Visual Basic 5 or 6 installed on your computer??? Have you used it yet??
The questions you are asking should be answered if you have.
When you open VB there is a standard window that appears,
which allows you to select what type of project you want. Select
Standard.
VB will then open the design environment and right before your
eyes will be a form. You can put controls on the form using the
control bar on the left of the screen. Select the control you wish
and either double click it or click it once and then draw the control.
You can write a program in VB with no .BAS (modules). You just
set the project properties (right click the .VBP name above your
form that is in the top right hand window, select properties) and
set the Startup Object to the form of your choice. In the instance
of a standard project, Form1, if you have not renamed the form.
Forms can hold sub routines, functions, event procedures, etc.
After you open the standard project, select the command button
control in your left hand window and then draw the command button to the size you wish. A button will appear with the text
Command1. In the middle window to the right, the properties
show for whatever control is selected. If the command button is
selected, then you should be able to change the CAPTION to
whatever you wish along with all the other properties.
Now double click your newly created command button and the
code window will appear with the following:
Private Sub Command1_Click
End sub
You put your code in between these lines and whenever you click
the command button, your code executes: (Event fires)
Try putting this in between:
MsgBox "Hello World!"
Now when you run your program by clicking the play button at
the top of your VB design window, your program will start and
when you click the command button you should see a message
box appear that says Hello World!.
Wallah! Your first VB program. Get a Teach Yourself VB in 21 days
book, install VB on your machine and do the exercises. You will
learn AN incredible amount in just a few short days, because not many people here will answer stuff like this...
We can show you how to drive the car, but you have to be able
to unlock the door and get in first!
"If I had known it was going to be that kinda party, I would have stuck my disk in the mash potatos!"
-
May 28th, 2002, 04:13 PM
#4
Thread Starter
New Member
Thanks
Thank you both,
I saw that VB was a development environment, but just woundered if there was a way to derive that code that they put out. Since the "compiler" or whatever that reads that .frm file, takes formatted syntax, there must be some generic format.
I do not want to be a graphical GUI/Development person, but would rather understand what the .frm file does. Like is it more or less a scripting file which later will be compiled into code which is references to Windows API calls?
Is there any documentation on that aspect, or is this really just this "VB has procedural imperative langauge aspects, but when it comes to GUIS, use their IDE?"?
I just didn't know if people are out there writing or generating their own code, or if they are just GUI users?
Thank you guys, this is starting to clear up what you probally see, and I admitt, as my VB fuzzy area.
Thank you,
-
May 28th, 2002, 04:24 PM
#5
Hyperactive Member
No problem...
Well... most developers use the GUI because VB is for rapid development and deployment. Meant to be fast... and cut out the extra coding.
The best thing for you to do is create the form as I suggested and then open it up with Notepad. It will show you all of the properties of the form including the control that are contained on it.
Hope it helps...
Good luck!
"If I had known it was going to be that kinda party, I would have stuck my disk in the mash potatos!"
-
May 28th, 2002, 04:26 PM
#6
Thread Starter
New Member
thanks, again
thank you for your time.
I will start to generate some code, and view it.
Thank you!!!!!
-
May 28th, 2002, 04:28 PM
#7
Frenzied Member
The reason you use vb is so that you area gui person, if you don't want to use that then use c++. There would be no reason to use anything but the vb development environment.
-
Jun 12th, 2002, 09:28 PM
#8
Lively Member
I also want to stress, Jango Fett, that it is not OK to use VB if you are building a clone army of 1,000,000 Maori warriors that can be used by an evil empire to take over the universe.
-
Jun 12th, 2002, 09:38 PM
#9
PowerPoster
Originally posted by tgoodmannz
I also want to stress, Jango Fett, that it is not OK to use VB if you are building a clone army of 1,000,000 Maori warriors that can be used by an evil empire to take over the universe.
Woohoo to many Star Wars movies.
Anyway,
VB helps creates the GUI interface using RAD... Creating the form is made easier (ever tried to create a DOS form?). It allows the user to focus on the aspect of coding the conceptual project, and allows an easy to create interface using Windows Standard forms as the basis of the design...
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Jun 12th, 2002, 11:04 PM
#10
Lively Member
-
Jun 12th, 2002, 11:05 PM
#11
PowerPoster
Well
Originally posted by tgoodmannz
hmmmph ... kiljoy
Need a tissue to wipe the tears?
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Jun 13th, 2002, 03:50 AM
#12
Lively Member
[yawn] I think I'll be OK...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|