You are on page 1of 10

Tutorial I

(1) When you first open a project, the IDE enters a mode called which mode? Answer:
Design Time

(2) When you run a project, the IDE enters a mode called which mode? Answer:
Runtime

(3) How can you create hot keys in VB.NET? Answer:


Hotkeys in VB.NET can be created by adding an ampersand (&) symbol in front of the letter you want to create as a hotkey. Example: &Submit = Submit

(4) How can you add comments in VB.NET? Answer:


Comments in VB.NET can be added by adding a single quotation mark () in front of the line of code. Example: This is a sample comment in VB.NET

(5) Explain the properties of a control: Text, Name Answer:


Text: o Displays a text on the control. o Example: First Name, Last Name, etc. for a labels text Name: o Is a unique name defined automatically (otherwise defined by the user) which is used to make a connection to the control while coding. o Example: lblFirstName, lblLastName, etc. for a labels name property

(refer slides)

(6) If you add three Label controls, three textbox controls and two button controls to an empty form, what will be their default names and what should be the name assigned by you? Answer:
lblLabel1, lblLabel2, lblLabel3 txtTextbox1, txtTextbox2, txtTextbox3 btnButton1, btnButton2

Note: Could be any name. But use naming conventions.


Prefix frm lbl txt btn mnu lnk cbo Object Class Form Label TextBox Button MenuStrip Item LinkLabel ComboBox

(7) How can we change the color of a form during runtime? Answer:
Change the BackColor property of the control. Or code a button which changes the BackColor of the form when clicked. (refer slides, internet, etc.)

(8) What VB.NET statements should be written to display a message APU is the best in a Textbox Answer:
txtTexbox.Text = APU is the best

(9) In how many ways we can change properties of a control? Explain with example Answer:
Two ways. Right-click the control and select properties Click the control and go into properties panel

(10) Suppose we want to develop an application that will display name, address and Mark of a student. The application should have controls like Label, Textbox, Button etc. as per good design of user interface. Button should be enabled and disabled as and when required. The application should have also option to exit from the program. Write a design, pseudocode and program steps for the application. Answer:
When "Click" button is pressed: - take the input from txtName, txtAddress, txtMark - display the input into the output label (lblOutput) When "Clear" button is pressed: - clear the values from txtName, txtAddress, txtMark, and lblOutput When "Exit" button is pressed: - close the application using either 'Me.Close()' or 'Application.Exit()'

(Draw the design, label the controls)

You might also like