You are on page 1of 30

Question 01:Design a form with three labels and two textboxes and command buttons .

design the concatenated string in third label. Display Screen:-

Code:Private Sub Command1_Click() Label5.Caption = Text1.Text + Text2.Text

End Sub

Private Sub Command3_Click() Text1.Text = "" Text2.Text = "" End Sub Input Window:-

Output Window:-

.. Question 02:Design a form with text box use the multiline and scroll property of the textbox. Display Screen:Code:Input Window:Output Window:-

.. Question 03:Design a form with command button to bring the picture by using style and picture property. Display Screen:Code:Input Window:Output Window:.. Question 04:Add item in the list box by using coding and without coding. a) Select the list property of the list box and add the item. b) Display Screen:Code:Input Window:Output Window:.. Question 05:Write a code for remove item from list box. Display Screen:Code:-

Input Window:Output Window:.. Question 06:Show the current time in the label with the help of times control. Display Screen:Code:Input Window:Output Window:.. Question 07:Design a book sales form take 9 labels, 3 text boxes and 2 command buttons. Calculates the total price, 15% of price and discount price. Display Screen:-

Code:Private Sub Command1_Click() Label8.Caption = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text) Label6.Caption = Label8.Caption - (Label8.Caption * Val(Text4.Text) / 100) End Sub

Private Sub Command3_Click() Form5.Visible = False Form7.Show End Sub

Private Sub Command4_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Label6.Caption = "" Label8.Caption = "" End Sub

Private Sub Form_Load() Text4.Text = 0

End Sub Input Window:-

Output Window:-

.. Question 08:Write to print table of any number given by the user. Display Screen:-

Code:Private Sub Command1_Click() For x = 1 To 10 Print Text1.Text * x Next x End Sub Input Window:-

Output Window:-

.. Question 09:-

Write a program for digital clock. Display Screen:Code:Input Window:Output Window:.. Question 10:Write a program to fly a plane(image) through image control and time control. Display Screen:-

Code:Private Sub Timer1_Timer()

Image1.Move Image1.Left + 100, Image1.Top + 30, Image1.Width + 30, Image1.Height + 30 End Sub Output Window:-

.. Question 11:Write a program for calculator. Display Screen:-

Code:Private Sub Command10_Click() Text1.Text = Text1.Text & "0" End Sub

Private Sub Command11_Click() Op1 = Val(Text1.Text) Opr = "+" Text1.Text = ""

End Sub

Private Sub Command12_Click() Op1 = Val(Text1.Text) Opr = "-" Text1.Text = "" End Sub

Private Sub Command13_Click() Op1 = Val(Text1.Text) Opr = "*" Text1.Text = "" End Sub

Private Sub Command14_Click() Op1 = Val(Text1.Text) Opr = "/"

Text1.Text = "" End Sub

Private Sub Command15_Click() Op2 = Val(Text1.Text) Select Case Opr Case "+": Text1.Text = Op1 + Val(Text1.Text) Case "*": Text1.Text = Op1 * Val(Text1.Text) Case "-": Text1.Text = Op1 - Val(Text1.Text) Case "/": Text1.Text = Op1 / Val(Text1.Text) End Select End Sub

Private Sub Command16_Click() Text1.Text = "" Op1 = 0 Op2 = 0

Opr = "" End Sub

Private Sub Command2_Click() Text1.Text = Text1.Text & "2" End Sub

Private Sub Command3_Click() Text1.Text = Text1.Text & "3" End Sub

Private Sub Command4_Click() Text1.Text = Text1.Text & "4" End Sub

Private Sub Command5_Click() Text1.Text = Text1.Text & "5"

End Sub

Private Sub Command6_Click() Text1.Text = Text1.Text & "6" End Sub

Private Sub Command7_Click() Text1.Text = Text1.Text & "7" End Sub

Private Sub Command8_Click() Text1.Text = Text1.Text & "8" End Sub

Private Sub Command9_Click() Text1.Text = Text1.Text & "9" End Sub

Input Window:-

Output Window:-

.. Question 12:Write steps for creating application in VB using data control. Display Screen:Code:Input Window:Output Window:.. Question 13:Write an application for accessing for creation of report in VB.

Display Screen:Code:Input Window:Output Window:.. Question 14:Design a form to show the working of drive list box, dirlistbox and filelistbox controls. Display Screen:-

Code:Private Sub Combo1_Click()

File1.Pattern = Combo1.Text End Sub

Private Sub Dir1_Change() File1.Path = Dir1.Path

End Sub

Private Sub Drive1_Change() Dir1.Path = Drive1.Drive

End Sub

Private Sub File1_Click()

End Sub Working Windows :-

.. Question 15:Print the following pattern. A A B A B C A B C D A B C D E Code:Private Sub Form_Load() Dim x, y As Integer

Form13.Show For x = 65 To 69 For y = 65 To x Print Chr(y); Print (" Next y Print print Next x ");

End Sub Output Window:-

.. Question 16:Write a program to print factorial of given no. Code:Private Sub Form_Load() Dim a As Integer, fact As Integer Form7.Show a = InputBox("enter a no")

fact = 1 For x = 1 To a a=a-1 fact = fact + (fact * a) Next x Print "the factorial of given no is"; fact End Sub Input Window:-

Output Window:-

.. Question 17:Write a program to final the greatest among three numbers. Display Screen:Code:Input Window:Output Window:.. Question 18:Write steps for creating database application in VB using Add-inc. Display Screen:Code:-

Input Window:Output Window:.. Question 19:Write steps for creating database application (MS Access) in VB using data control using code. Display Screen:Code:Input Window:Output Window:.. Question 20:Design a menus through menu editor. Display Screen:Code:Input Window:Output Window:..

You might also like