Wednesday, November 21, 2007

VB QUIZ 1




Visual Basic Exam Projects.




Below are a selection of college exam papers that you are lickly to take if you live in North America the following paper is taken from a years study on a course so if you can do any of this before this time then you have notthing to worry about. If you decide to take the real thing.
The Exam project 3 is loading please wait
Goto Project 4










DATA FILES
Create the following sequential files:



· Current file CUSTOMER.TXT





Customer No
LastName FirstName Address City State Zip

12345 JONES MARY 123 MAIN ST FLAGSTAFF AZ 6001
98765 SMITH WALDORF 5487 MUPPET TX 75221


56124 CHAVEZ JUANITA 2578 MARQUIS HOBBS NM 79111

22117
REDF. GUY BOX 1002 TULSA OK 74136

· Current file ORDERS.TXT

Invoice CustomerNo Total
99001 12345 1587.20



99002 22117 2586.32

· PC.TXT






Description Price
Pentium II - 200Mhz 799
Pentium II - 233Mhz 875
Pentium II - 266Mhz 999
Pentium II - 300Mhz 1223
Pentium II - 400Mhz 1434
Pentium III - 500Mhz 1798
Pentium III - 600Mhz 2176




WELCOME SCREEN






Create a form like the following that only appears when your application is started. Include the name, ID, and section number of all who worked on the project. When the GO button is pressed, bring up the Customer form.









CUSTOMER FORM




Make sure all controls are cleared out in the code when the customer form is activated. Focus should be on the customer number text box. The Lookup and Quit buttons should be enabled. The Order button should be disabled.




Use a control array of text boxes in the Customer Information frame. Also use a dropdown combo box to display the states in sorted order. The user must pick only from the states listed.



Allow the user to enter up to a five-digit numeric customer number. Do not read any files until a five-digit number has been entered. Notify the user of any errors when they press the Lookup button. If the user enters an existing customer number, display the customer information frame with all data for that customer. The frame should be disabled to prevent user entry. The Add Customer button should not be visible. The Order and Quit Buttons should be enabled at this time.




If the user enters a valid number, but the customer does not exist in the file, ask the user in a message box if they would like to add a new customer. If the answer is No, clear all controls and rest focus on the customer number. If the answer is Yes, allow the user to enter name, address, etc. in the customer information frame. Enable the Add Customer button. If anything is left blank, notify the user with a message box and reset focus on that control. Loop through the controls to see if they are blank. Only display one error message at a time. If all customer information is complete and the user presses the Add Customer button, append the new customer to the file. Enable the Order button.




If the user presses the Quit button, terminate the application. If the user presses the order button display the Order Form.





ORDER FORM



Draw frames for the processor, RAM, and options. Use a dropdown combobox for the processesor that does not allow the user to enter any new information to the list. Use control arrays for the option buttons and checkboxes. The back color for the Accept button should be green and the back color of the Reject button should be red.



Load the processor dropdown combobox and clear all controls. Display the customer First and Last Name in the Customer Name label. The new invoice number should be one (1) greater than the highest invoice number in the invoice file. The invoice date is the system date.



By default, the order should first display the slowest processor and 16Mb of RAM. The appropriate prices should appear in the labels to the right. The sales tax rate comes from the sales tax file and is dependent upon the customer's state. The total invoice amount should be displayed for the default system.



NOTE: After the processor combo box is loaded once, do not read the file a second time to get the prices. The values on the invoice should change dependent upon the user's choices. The totals should be recomputed every time something changes using a programmer-defined subroutine procedure or function. The following table should be used to determine the amount charged for memory and options (these can be hard coded for this project):




RAM Options

16Mb 0 Modem 150


32Mb 75 Sound Card 189


64Mb 150 Graphics Card 225



128Mb 300 Color Printer 249



256Mb 700 Monitor 399



CD ROM 199



If the user presses the Reject button, return to the Customer form with all of the controls cleared and focus on the customer number. If the user presses the Accept button, make sure that, at least, the processor and RAM are complete-no options are required. Post the necessary information to the Order File and then return to a clear Customer form with all controls cleared and focus on the customer number.


VISUAL BASIC LESSON 1

Lesson 1
Hopefully you will learn this during lesson 1. :
· About the Development Environment
· The project explorer windows
· Running a form
· Making your first *.exe
· Understanding the tool bar
· Introducing Source code
· Command Button properties
· Explanations of global modules
· Opening an existing Visual Basic project.
· Explore the forms and the source code behind the an existing project in design mode
· Recognise and understand the function of the main component of the Visual Basic environment eg. toolbar's , toolboxes , project window, properties window and most importantly the source code window.
· Saving your project to a file.
· Button Properties.

The Development Environment

Learning the ins and outs of the Development Environment before you learn visual basic is somewhat like learning for a test you must know where all the functions belong and what their purpose is. First we will start with labelling the development environment.


The above diagram shows the development environment with all the important points labelled. Many of Visual basic functions work similar to Microsoft word eg the Tool Bar and the tool box is similar to other products on the market which work off a single click then drag the width of the object required. The Tool Box contains the control you placed on the form window. All of the controls that appear on the Tool Box controls on the above picture never runs out of controls as soon as you place one on the form another awaits you on the Tool Box ready to be placed as needed.


The project explorer window
The Project explorer window gives you a tree-structured view of all the files inserted into the application. You can expand these and collapse branches of the views to get more or less detail (Project explorer). The project explorer window displays forms, modules or other separators which are supported by the visual basic like class'es and Advanced Modules. If you want to select a form on its own simply double click on the project explorer window for a more detailed look. And it will display it where the Default form is located.

Properties Window


Some programmers prefer the Categorisized view of the properties window. By defaulting, the properties window displays its properties alphabetically (with the exception of the name value) when you click on the categorized button the window changes to left picture.

The Default Layout
When we start Visual Basic, we are provided with a VB project.A VB project is a collection of the following modules and files.
The global module( that contains declaration and procedures)
The form module(that contains the graphic elements of the VB application along with the instruction )
The general module (that generally contains general-purpose instructions not pertaining to anything graphic on-screen)
The class module(that contains the defining characteristics of a class, including its properties and methods)
The resource files(that allows you to collect all of the texts and bitmaps for an application in one place)

On start up, Visual Basic will displays the following windows :
The Blank Form window
The Project window
The Properties window
It also includes a Toolbox that consists of all the controls essential for developing a VB Application. Controls are tools such as boxes, buttons, labels and other objects draw on a form to get input or display output. They also add visual appeal.
Understanding the tool box.


You may have noticed that when you click on different controls the Properties Window changes slightly this is due to different controls having different functions. Therefore more options are needed for example if you had a picture then you want to show an image. But if you wanted to open a internet connection you would have to fill in the remote host and other such settings. When you use the command ( ) you will find that a new set of properties come up the following will provide a description and a property.

Opening an existing Visual Basic project.


Microsoft have included some freebies with visual basic to show its capabilities and functions. Dismantling or modifying these sample projects is a good way to understand what is happening at runtime. These files can be located at your default directory /SAMPLES/
To Open these projects choose 'Open Project' from the 'File' menu. Then Double click on the samples folder to open the directory then Double click on any project to load it.
Opening a new visual basic file & Inserting Source code.
From looking at the examples it time to make your own application. Choose 'New Project' from the 'File' menu. Use the blank form1 to design a simple interface for an estate agents database, have some textboxes for names and other details. Insert some controls and make it look professional. Textboxes can be used to store there name and other details, make sure you put a picture box in for a picture of the house.

Now insert the following source code for your application.

Private Sub Form_Load()

Picture1.Picture = LoadPicture("C:\Program Files\VB\Graphics\Icons\Misc\MISC42.ICO")

End Sub


Running and viewing the project in detail.


Once an application is loaded it can be run by click on the icon from the toolbar, to pause press and to terminate use .


Once a project is loaded, the name of the form(s) that it contains is displayed in the project window. To view a form in design mode, select the form required by clicking with the mouse to highlight its name, then clicking on the view form button.


In this example the project has been loaded and the maillist.frm has been selected for viewing. This Ms Mail example project useds 6 forms and 1 modules.


In Design mode, when the form is viewed, the code attached to any screen object may be inspected by double clicking on that object.

The screen shots below show the interface of the Ms Mail example (.../samples/Comtool/VBMail/MaiLLST.FRM) to view the code for this form select from the project window item.


Private Sub SetupOptionForm(BasePic As Control)


BasePic.Top = 0BasePic.Left = 0 BasePic.Visible = TrueBasePic.enabled = TrueOKBt.Top = BasePic.Height + 120Me.width = BasePic.Width + 120 Me.Heigh = OkBt.Top + OkBt.Height + 495


End Sub

Making your first *.exe!?


To make an excutable from a project choose 'MakeMake project.exe from the 'File' menu. Then click once on the Make project.exe choose a default location to store your executable, you can also change some advanced options by clicking on the Options.. tag before saving your exe
The above image will be displayed in the comment's value type some comments company name name etc... The Title tag represents the caption you will see if you press Control + Alt + Del. And the icon is the icon that will be available on the execute icon. As you can see it is quite simple to understand. All the comments, data and name appear when you click on the compiled (execute) exe and click properties.


Saving your visual basic project.


Save your work to disk. Use the Windows Explorer or any desktop windows to check that all files have been saved. There should be one Visual Basic Project (.VBP) file and separate Form (.FRM) and Module (.BAS) files for each form and module used in the current project.
Button Properties for reference, Command Button & labels properties Property Description
Name The name of the object so you can call it at runtime
BackColor This specifies the command button's background color. Click the BackColor's palette down arrow to see a list of common Windows control colours, you must change this to the style property from 0 - standard to 1 - graphical
Cancel Determines whether the command button gets a Click event if the user presses escape

Caption Holds the text that appears on the command button.
Default
Determins if the command button responds to an enter keypress even if another control has the focus
Enable
Determines whether the command button is active. Often, you'll change the enable property at runtime with code to prevent the user pressing the button
Font
Produces a Font dialog box in which you can set the caption's font name , style and size.
Height
Positions the height of the object - can be used for down
Left
Positions the left control - can be used for right
MousePointer
If selected to an icon can change the picture of the mouse pointer over that object
Picture
Hold's the name of an icon graphic image so that it appears as a picture instead of a Button for this option to work the graphical tag must be set to 1
Style
This determins if the Command Button appears as a standard windows dialog box or a graphical image
Tab index
Specifies the order of the command button in tab order
Tab Stop
Whether the object can be tabbed to ( this can be used in labels which have no other function )
Tool Tip Text
If the mouse is held over the object a brief description can be displayed (for example hold your mouse over one of the above pictures to see this happening
Visible
If you want the user to see the button/label select true other wise just press false
Width
Show the width of the object

Mail me at master.agarwal@yahoo.co.into receive latest updates and source cods and be in touch.

Tuesday, November 20, 2007

COMPUTER SOLUTIONS








LEARN IN EASY STEPS








LEARN IN EASY
STEPS 



We are here to give you our best knowledge about computers and
other Accounting ways.  We want that each person get knowledge about every
field and specially about our faster growing IT-Fields.


So we will try our level best to give you knowledge
whatever  we  can provide to you.


Not only this we are here to solve all problems of
yours, related to computer Accounting and other Topics too.


We will consternate on Solving
computer problems and providing you the knowledge about computer programming
like C, C++, Visual Basic Programming.,  Windows Tips and Tricks , How to
Stop Hacking in your personal computer. learning about Java Scripts and other
many languages.


In this site we will not only
teach you how to use but also going to provide you the programming codes Best of
our knowledge.


Here before, I
start sharing my knowledge with you all,  I want to warn you that this site
is made for sharing knowledge for helping other, not for creating problems . So
please help other's with the knowledge.


 


warning:
This Site is not responsible for any type of miss- use of knowledge and also for
any harm   made to you. 


Now we will start with some useful Triks.


How
to disable Enable or use System Restore for Windows


Every time you download or install a new game, application, or software
update, you make changes to your computer. Sometimes that change may make your
system unstable. Have you ever wanted to go back to the way it was? With System
Restore, you can.


How does System restore work?


Windows XP periodically records a snapshot of your computer. These snapshots
are called restore points. Windows XP also creates restore points at the time of
significant system events (such as when an application or driver is installed)
or you can create and name your own restore points at any time. If you?€?ve
installed a program that has made your computer unstable, you can open system
restore, choose a restore point, and return your computer to its previous stable
state.


How to Enable or Disable System restore?



  • Properties
    My Computer Locate System Restore tap

  • If
    you want turn off system restore on all drives please check enable it or
    if you want turn off each drive click drive and click setting.


How to Restore windows by System Restore?



  • Click
    Start Menu > Programs > Accessories, point to System Tools, and then
    click System Restore. System Restore starts.

  • On
    First page click Restore my computer to an earlier time (if it is not
    already selected), and then click Next.

  • On
    the Select a Restore Point page, click the most recent system checkpoint
    in the

  • On
    this list, click a restore point list, and then click Next. A System
    Restore message may appear that lists configuration changes that System
    Restore will make.

  • Click
    OK.

  • Confirm
    Restore Point Selection, click Next. System Restore will restore the
    previous Windows XP, and then restarts the computer.


Note: you must log in as Administrators member


If you want start windows normally you will use system restore in safe mode.



  • Restart
    your computer, and then press F8 during the initial startup to start your
    computer in Safe Mode with a command prompt.

  • Type
    the following command at a command prompt, and then press
    ENTER:%systemroot%\system32\restore\rstrui.exe


Follow the instructions that appear on the screen to
restore your computer to an earlier state.

I
hope u liked the Trick don't you, Be careful and read all post properly before
using practically.


how
to send instant message dialog to someone on network


This method help you send a message dialog to any user on network by NET SEND
command line.


Open command prompt by going to .. start > run > and type cmd


use command “net send”


Example:1

You want to send message “hello this is test msg from IT” to computer
machine name “pc1″


follow this command

net send /DOMAIN:pc1 “hello this is test msg from IT” and
press Enter


Example:2

You want to send same message to everyone on the network use this command


net send * “hello this is test msg from IT”


The message will be send to everyone


Remark



  • You
    can send a message only to a name that is active on the network. If you
    send the message to a user name, that user must be logged on and running
    the Messenger service to receive the message.


The Messenger service must be running for messages to
be received. For more information about how to start a service.

 
Visual
Basic


 


Welcome
to the Visual Basic Section






  
Tutorial for new
visual basic er's and advanced level

Source code a collection of over 70+ visual basic
source code





Visual
Basic Tutorial Summary:


Go to
Lesson 1 Now


  • About
    the Development Environment


  • The
    project explorer windows


  • Running
    a form


  • Making
    your first *.exe


  • Understanding
    the tool bar


  • Introducing
    Source code


  • Command
    Button properties


  • Explanations
    of global modules


  • Opening
    an existing Visual Basic project.


  • Explore
    the forms and the source code behind the an existing project in design
    mode


  • Recognize
    and understand the function of the main component of the Visual Basic
    environment e.g.. toolbar's , toolboxes , project window, properties
    window and most importantly the source code window.


  • Saving
    your project to a file.


  • Button
    Properties.



    Go to Lesson 2 Now

  • Know
    what an Event is.


  • Determine
    what Events a control can have


  • Write
    code for one or more Events.


  • Using
    option buttons to produce an event


  • Using
    checkboxes to produce an event


  • Grouping
    controls using a frame


  • Make
    a simple alteration to the interface, such as changing background color,
    at run time.


  • Creating
    a list box.


  • Remove
    and Add list box's functions.


  • Creating
    Combo Boxes


  • What
    the different types of combo boxes are.



    Go to Lesson 3 Now

  • Displaying
    Message Boxes


  • Opening
    Files


  • Retrieving
    Information from files


  • Saving
    Information to files


  • Printing
    text to the printer



    In next Topic we will discuss about the different Lessons of Visual
    Basic.


    Mail me at master.agarwal@yahoo.co.in
    to  receive latest updates and source cods  and be in touch.




 


 


 





Learn in Simple Steps


LEARN IN EASY STEPS

We are here to give you our best knowledge about computers andother Accounting ways. We want that each person get knowledge about everyfield and specially about our faster growing IT-Fields.

So we will try our level best to give you knowledgewhatever we can provide to you.

Not only this we are here to solve all problems ofyours, related to computer Accounting and other Topics too.

We will consternate on Solvingcomputer problems and providing you the knowledge about computer programminglike C, C++, Visual Basic Programming., Windows Tips and Tricks , How toStop Hacking in your personal computer. learning about Java Scripts and othermany languages.

In this site we will not onlyteach you how to use but also going to provide you the programming codes Best ofour knowledge.

Here before, Istart sharing my knowledge with you all, I want to warn you that this siteis made for sharing knowledge for helping other, not for creating problems . Soplease help other's with the knowledge.

warning:This Site is not responsible for any type of miss- use of knowledge and also forany harm made to you.

Now we will start with some useful Triks.

Howto disable Enable or use System Restore for Windows

Every time you download or install a new game, application, or softwareupdate, you make changes to your computer. Sometimes that change may make yoursystem unstable. Have you ever wanted to go back to the way it was? With SystemRestore, you can.

How does System restore work?

Windows XP periodically records a snapshot of your computer. These snapshotsare called restore points. Windows XP also creates restore points at the time ofsignificant system events (such as when an application or driver is installed)or you can create and name your own restore points at any time. If you?€?veinstalled a program that has made your computer unstable, you can open systemrestore, choose a restore point, and return your computer to its previous stablestate.

How to Enable or Disable System restore?

Properties My Computer Locate System Restore tap
If you want turn off system restore on all drives please check enable it or if you want turn off each drive click drive and click setting.

How to Restore windows by System Restore?

Click Start Menu > Programs > Accessories, point to System Tools, and then click System Restore. System Restore starts.
On First page click Restore my computer to an earlier time (if it is not already selected), and then click Next.
On the Select a Restore Point page, click the most recent system checkpoint in the
On this list, click a restore point list, and then click Next. A System Restore message may appear that lists configuration changes that System Restore will make.
Click OK.
Confirm Restore Point Selection, click Next. System Restore will restore the previous Windows XP, and then restarts the computer.

Note: you must log in as Administrators member

If you want start windows normally you will use system restore in safe mode.

Restart your computer, and then press F8 during the initial startup to start your computer in Safe Mode with a command prompt.
Type the following command at a command prompt, and then press ENTER:%systemroot%\system32\restore\rstrui.exe
Follow the instructions that appear on the screen torestore your computer to an earlier state.

Ihope u liked the Trick don't you, Be careful and read all post properly beforeusing practically.

howto send instant message dialog to someone on network

This method help you send a message dialog to any user on network by NET SENDcommand line.

Open command prompt by going to .. start > run > and type cmd

use command “net send”

Example:1
You want to send message “hello this is test msg from IT” to computermachine name “pc1″

follow this command
net send /DOMAIN:pc1 “hello this is test msg from IT” andpress Enter

Example:2
You want to send same message to everyone on the network use this command

net send * “hello this is test msg from IT”

The message will be send to everyone

Remark

You can send a message only to a name that is active on the network. If you send the message to a user name, that user must be logged on and running the Messenger service to receive the message.
The Messenger service must be running for messages tobe received. For more information about how to start a service.

VisualBasic

Welcometo the Visual Basic Section


Tutorial for newvisual basic er's and advanced level
Source code a collection of over 70+ visual basicsource code

VisualBasic Tutorial Summary:

Go toLesson 1 Now
About the Development Environment
The project explorer windows
Running a form
Making your first *.exe
Understanding the tool bar
Introducing Source code
Command Button properties
Explanations of global modules
Opening an existing Visual Basic project.
Explore the forms and the source code behind the an existing project in design mode
Recognize and understand the function of the main component of the Visual Basic environment e.g.. toolbar's , toolboxes , project window, properties window and most importantly the source code window.
Saving your project to a file.
Button Properties.

Go to Lesson 2 Now
Know what an Event is.
Determine what Events a control can have
Write code for one or more Events.
Using option buttons to produce an event
Using checkboxes to produce an event
Grouping controls using a frame
Make a simple alteration to the interface, such as changing background color, at run time.
Creating a list box.
Remove and Add list box's functions.
Creating Combo Boxes
What the different types of combo boxes are.

Go to Lesson 3 Now
Displaying Message Boxes
Opening Files
Retrieving Information from files
Saving Information to files
Printing text to the printer

In next Topic we will discuss about the different Lessons of Visual Basic.

Mail me at master.agarwal@yahoo.co.in to receive latest updates and source cods and be in touch.