P. 1
visual basic experiments

visual basic experiments

|Views: 13|Likes:
Published by Dhruv Parmar

More info:

Published by: Dhruv Parmar on Aug 25, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

08/25/2012

pdf

text

original

Student name: Roll No.

:

Practical No. :1 Title:
INPUT FORM

1 College Name: Subject Name:

Student name: Roll No.:

CODE Private Sub Form_Load() Label1.Caption = Form1.Width Label2.Caption = Form1.Height End Sub Private Sub Form_Resize() Label1.Caption = Form1.Width Label2.Caption = Form1.Height End Sub Private Sub Form_Unload(Cancel As Integer) If MsgBox("Are you sure ?", vbQuestion + vbYesNo, "Warning!!!") = vbNo Then Cancel = True End Sub

2 College Name: Subject Name:

Student name: Roll No.:

OUTPUT FORM

3 College Name: Subject Name:

Student name: Roll No.:

Practical No. :2 Title:
INPUT FORM

4 College Name: Subject Name:

Student name: Roll No.:

CODE Dim p As Boolean Private Sub Form_Load() DrawWidth = 10 ForeColor = RGB(255, 0, 0) End Sub Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) p = True End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If p Then PSet (X, Y) End If End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) p = False End Sub

5 College Name: Subject Name:

Student name: Roll No.:

OUTPUT FORM

6 College Name: Subject Name:

Student name: Roll No.:

Practical No. :4 Title:
INPUT FORM

7 College Name: Subject Name:

Student name: Roll No.:

CODE Private Sub Command2_Click() If Label1.Enabled = True Then Label1.Enabled = False Else Label1.Enabled = True End If End Sub Private Sub Command3_Click() If Label1.Visible = True Then Label1.Visible = False Else Label1.Visible = True End If End Sub Private Sub Form_Load() Label1.Top = 0 m = 50 End Sub

8 College Name: Subject Name:

Student name: Roll No.:

OUTPUT FORM

9 College Name: Subject Name:

Student name: Roll No.:

Practical No. :5 Title:
INPUT FORM

10 College Name: Subject Name:

Student name: Roll No.:

CODE Private Sub Form_Load() End Sub Private Sub Option1_Click() Label1.FontBold = True End Sub Private Sub Option2_Click() Label1.FontBold = False End Sub Private Sub Option3_Click() Label1.FontItalic = True End Sub Private Sub Option4_Click() Label1.FontItalic = False End Sub Private Sub Option5_Click() Label1.FontUnderline = True End Sub Private Sub Option6_Click() Label1.FontUnderline = False End Sub

11 College Name: Subject Name:

Student name: Roll No.:

OUTPUT FORM

12 College Name: Subject Name:

Student name: Roll No.:

Practical No. :6 Title:
INPUT FORM

13 College Name: Subject Name:

Student name: Roll No.:

CODE Private Sub Check1_Click() If Label1.FontBold = True Then Label1.FontBold = False Else Label1.FontBold = True End If End Sub Private Sub Check2_Click() If Label1.FontItalic = True Then Label1.FontItalic = False Else Label1.FontItalic = True End If End Sub Private Sub Check3_Click() If Label1.FontUnderline = True Then Label1.FontUnderline = False Else Label1.FontUnderline = True End If End Sub Private Sub Form_Load() End Sub

14 College Name: Subject Name:

Student name: Roll No.:

OUTPUT FORM

15 College Name: Subject Name:

Student name: Roll No.:

Practical No. :7 Title:
INPUT FORM

16 College Name: Subject Name:

Student name: Roll No.:

CODE Private Sub Command1_Click() Combo1.Clear Combo1.AddItem "Green" Combo1.AddItem "Blue" Combo1.AddItem "Red" End Sub Private Sub Command2_Click() Combo1.Clear Combo1.AddItem "Cricket" Combo1.AddItem "Vollyball" Combo1.AddItem "Football" End Sub Private Sub Command3_Click() Combo1.Clear Combo1.AddItem "Parrot" Combo1.AddItem "Peacock" Combo1.AddItem "Crow" End Sub Private Sub Form_Load() Combo1.Clear End Sub

17 College Name: Subject Name:

Student name: Roll No.:

OUTPUT FORM

18 College Name: Subject Name:

Student name: Roll No.:

Dim buf As Integer Dim op As Integer Private Sub Command1_Click() Text1.Text = Text1.Text + "1" End Sub Private Sub Command10_Click() Text1.Text = Text1.Text + "0" End Sub Private Sub Command11_Click() buf = Val(Text1.Text) op = 1 Text1.Text = "" End Sub Private Sub Command12_Click() buf = Val(Text1.Text) op = 2 Text1.Text = "" End Sub Private Sub Command13_Click() buf = Val(Text1.Text) op = 3 Text1.Text = "" End Sub Private Sub Command14_Click() buf = Val(Text1.Text) op = 4
19 College Name: Subject Name:

Student name: Roll No.:

Text1.Text = "" End Sub Private Sub Command15_Click() If op = 1 Then Text2.Text = buf + Val(Text1.Text) End If If op = 2 Then Text2.Text = buf - Val(Text1.Text) End If If op = 3 Then Text2.Text = buf * Val(Text1.Text) End If If op = 4 Then Text2.Text = buf / Val(Text1.Text) End If End Sub Private Sub Command16_Click() Text1.Text = "" 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"
20 College Name: Subject Name:

Student name: Roll No.:

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

21 College Name: Subject Name:

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->