Fusion Universe
March 29, 2024, 01:46:09 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Forum Launched
 
  Home Help Search Arcade Gallery Staff List Login Register  

The Layout

Pages: [1]
  Print  
Author Topic: The Layout  (Read 81 times)
Sunreal
Admin Crew
Ultime User
********
Offline Offline

Posts: 1001


I like elfenlied :D


View Profile WWW
« on: July 29, 2008, 06:36:03 am »

Hi, welcome to this visual basic 6.0 tutorial about the layout.
Lets start opening a project by
 clicking File-->> New Project

It will bring you a dialog of various kinds of program intentions:
Standard EXE ::> Simple, what you program is what you see, requires windows only
ActiveX EXE ::> This program acts like an activeX DLL, but has its own workingspace (Dunno how to explain this very well)
activeX DLL ::> What it says, its a dinamicly linked library, but supports COM, which means "Component object model"
activeX Control ::> (I never use ActiveX, so i cant really tell what control does) ActiveX controls control the gathering the information for applications that work over the internet.

I never used the rest, xD, so i cant list more,

lets continue with the standard EXE by selecting it, and pressing OK.
Now, All kinds of things are popping up, project1-form1 window, Tools and controls, properties menu etc.
well, lets have a look at the general tools:
Simple yet effective, The pointer
Used for selecting controls in forms, such as buttons, textboxes, listboxes and imageboxes etc.

The picturebox
This control is used for loading pictures into your program

The label
A object that will be and is used very much, probably almost all visual basic programs contain at least 1 label
this object can hold various characters and signs.

The Textbox
This tool is probably along with the command button the most used object in visual basic.
It allows the program to read text from the textbox, whatever the user of the program has entered.
From a value, till a story.

The frame
Its used to seperate objects and controls from an area in a form.Is also used in combination of tabs.

The button
This control is likely the most used in visual basic, there is probably no program without it.

The checkbox
Its actualy an boolean control, checked = on ( true ) unchecked = off ( false )

The radiobutton
Can be used to make selections, you need to explore this control to know what to do with this

The combobox
Its the same as an droplist, but you can change the text

The listbox
This is a list, simple, yet effective

The timer
Also a well-known object for timing functions, good for checking time, calculate repeatable stuff,  etc.
also used alot

This where all basic controls, which are also used alot.


This is our form, i added some controls to it, and gave it a color for background.

another thing to know, is the properties menu.
This tool will be used alot when editing controls and objects


Name : "is the objects name used for coding of the programmer"
Backcolor : "Is the color on the background"
Enabled : "When program is active, can the button ( in this case ) be clicked"
Font: "What it says, the text display font of the button"
Height: "The buttons height"
Width: "The buttons Width"
Left : "how far away is the button from the leftside"
Mouse-pointer: "The icon that the program will give when mouse-over the button"
Picture: "when style is set to grapical, the gray color turns into the picture you uploaded to your program"
Style: "Style has 2 options, Standard:graphical ,  Standard = standard grey and black etc, graphical is costimizeable"
Tabindex: "determinate what the rank is when pressing TAB key( when program is active )"
Tooltiptext: " when mouse-over the button, after a few seconds it will show this text"
Top: "How far away is the button from the topside"
Visible: "Is the button visible or not when running the program" ( True = visible )

I skipped some which are listed above in the picture, but i am no god either, i dont have all time and knowledge of the world.

So, after you learn how to use these things, you can add codes, simple, by double clicking on the object or form.
then you get the following window:


where "load" is located, thats the place when the button does that function:
why do they do that?, its because when this form loads, it will perform the actions in the coding area.
But, imagine, you want it also do something else, nut not on load, but when the program of form unload/quit?
thats why they have that, in the list of a form, you can select load, but also unload, you can add your own operations later when you are further in visual basic.

The operations are very usefull.
imagine, you want, when a textbox got focused ( selected ), that every letter you write, will be saved into an variable.
then, you can simply select textbox1 in the coding objectlist, and as operation, on keychange.
stringvar = textbox1.text
but, now it always does this, so, we put it in a timer, which can be disabled and enabled:

we now have, 1 textbox, and 1 timer, on form load do:
"timer1.enabled = false"
"timer1.interval = 250" without quotes

then to enable it,
select textbox1 in object menu, and operation gotfocus.
then type "Timer1.Enabled = true" without quotes
after done that, select lostfocus.
then type there
"Timer1.Enabled = False" without quotes

now the timer, is on focus enabled, and no focus disabled.
to make it work like we said, we need the timer do something
now,
to make a variable getting all text in textbox1, do the following:

dim variable as string
variable = texbox1.text

simple, yet effective.

now, we can test our program, because it does something.
you can do that, by clicking the blue "arrow" on the middle toolbar looking like this:


after everything is OK, we can make it an .EXE file, also known as Executeable
You can do that, by clicking FILE::>> Make "Project1".exe without quotes
note, if you renamed your project, the text between quites will be changed 2.


well, thats all for now, hope you learned something

fusion universe, sunreal
FuT , Fusion universe Tutorials
« Last Edit: August 08, 2008, 12:40:33 pm by Sunreal » Report Spam   Logged

Share on Facebook Share on Twitter

Pages: [1]
  Print  
 
Jump to:  

Bookmark this site! | Upgrade This Forum
Free SMF Hosting - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy