0% found this document useful (0 votes)
24 views11 pages

Project Ion VB

The document contains instructions for 5 questions asking to design Visual Basic applications using different controls and functions. Question 1 prints a welcome message, Question 2 performs arithmetic on user-entered numbers, Question 3 changes the background color when text is changed, Question 4 displays messages with user input, and Question 5 demonstrates mouse events on labels.

Uploaded by

Shikha Trehan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views11 pages

Project Ion VB

The document contains instructions for 5 questions asking to design Visual Basic applications using different controls and functions. Question 1 prints a welcome message, Question 2 performs arithmetic on user-entered numbers, Question 3 changes the background color when text is changed, Question 4 displays messages with user input, and Question 5 demonstrates mouse events on labels.

Uploaded by

Shikha Trehan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Assignment1

Q1 Design an application to print in the message box welcome to visual basic

Private Sub Command1_Click () MsgBox ("welcome to vb") End Sub

Q2 Design an application to perform arithmetic operations of two numbers entered by the user

Private Sub add _ Click () Text3.Text = Val (Text1.Text) + Val (Text2.Text)

End Sub

Private Sub sub __ Click () Text4.Text = Val (Text1.Text) - Val (Text2.Text) End Sub

Private Sub divide _ Click () Text5.Text = Val (Text1.Text) / Val (Text2.Text) End Sub

Q3 Design an application when a user changes a text in the textbox the background color changes.

Private Sub Text1_Change () Form1.BackColor = black End Sub

Q4 Write a program to display the following messageshello, bye, and end

Private Sub Command1_Click () MsgBox ("hello ") + (Text1.Text)

End Sub

Private Sub Command2_Click () MsgBox ("bye ") + (Text1.Text) End Sub

Private Sub Command3_Click () End End Sub

Q5 Design an application to show the usage of different controls

Private Sub Label2_MouseDown (Button As Integer, Shift as Integer, X As Single, Y as Single) Text1.Text = ("down") End Sub

Private Sub Label1_MouseMove (Button As Integer, Shift as Integer, X As Single, Y as Single) Text1.Text = ("move") End Sub

Private Sub Label2_MouseUp (Button As Integer, Shift as Integer, X As Single, Y as Single) Text1.Text = ("up") End Sub

You might also like