Creating Simple Application in Visual Basic Making Different - TopicsExpress



          

Creating Simple Application in Visual Basic Making Different Applications Creating an application inVisual Basicis simple. You have already learnt a lot about creating aVISUAL BASICapplication. Now it will take just a minute to create your firstVISUAL BASICapplication. First of all let us make a SimpleHelloapplication, As we do in other programming language: Hello Visual Basic Application: For Animated Presentation Click Here The first step in building aVisual Basicapplication is to create the forms that will be the basis for your applications interface. Then you draw the objects that make up the interface on your forms. For this first application, you will use two controls from theToolbox. 1. Clicktool Boxfor the control you choose to draw - In this case, thetext box. Move the pointer onto your form. The pointer becomes a cross hair. 2. Place the cross hair where you want the the control. 3. Drag the cross hair until the control is the size you want. 4. Release the mouse button. Form will look like the figure: For the Hello, VB! example, you will need to change three property settings. Use the default settings for all other properties: ObjectPropertySetting FormCaptionHello VB Command ButtonCaptionOK TextboxText(Empty) After property setting form will look like: Writing Code: 1. For this example, choose thecommand button, Command1. 2. In the Procedurelist box, select the name of an event for the selected object: Here, theClickprocedure is already selected, because its the default procedure for a command button. Type the following code between theSubandEnd Substatements: Text1.Text = Hello, VB! The event procedure will look like this: Private Sub Command1_Click () Text1.Text = Hello, VB! End Sub Running the Application To run the application, chooseStartfrom theRun menu, orclicktheStartbutton on thetoolbar,or pressF5. Clickcommand buttonyou have created on theformand you will seeHello,VB! displayed in text box. An application using Mathematical Operations For Animated Presentation Click Here Now you will create an application which performs two operations: 1. ADD 2. MULTIPLY Designing the interface 1. Select a New project fromfile menu,then selectstandard EXE. 2. Place controls in the form to create the user interface according to the figure: 3. Now for above example, you will need to change different property settings. Change the properties according to the figure: Use the default settings for all other properties. Property Table: ObjectPropertySetting FormCaptionMathematical Calculations Command Button1CaptionADD Command Button2CaptionMULTIPLY Command Button3CaptionEXIT Textbox1Text(Empty) Textbox2Text(Empty) Textbox3Text(Empty) Label1Caption1st Number Label2Caption2nd Number Label3CaptionResult After setting the properties for different controls the form will look like figure:
Posted on: Tue, 15 Oct 2013 02:30:43 +0000

Trending Topics



Recently Viewed Topics




© 2015