Sunteți pe pagina 1din 6



Experiment No.7
Group A Q.No.1. Answer : Following are the properties of Timer Control :1. Name 2. Enabled 3. Index 4. Interval Q. No. 2 Answer : Timer control is hidden at the run time as it does not have Click, Dragover, or KeyPress events at all. Timer control, controls all other controls on form and regulates other applications. Q.No. 4 Answer : Option Explicit Dim startime, stoptime As Variant Private Sub cmdstp_Click() stoptime = Now lblstop.Caption = Format(stoptime, "hh:mm:ss") End Sub Private Sub cmdstrt_Click() startime = Now lblstart.Caption = Format(startime, "hh:mm:ss") End Sub Private Sub Timer1_Timer() lbldiff.Caption = Format(stoptime - startime, "hh:mm:ss") End Sub 5. Left 6. Tag 7. Top


2 Caption Difference Start Stop Interval 1000

Controls Label1 Label2 Label3 Label4 Command1 Command2 Timer1

Name lblstart lblstop Label3 lbldiff cmdstrt cmdstp Timer1

Experiment No.8
Q.No. 1. Answer : Private sub cmdsize_Click( ) Rtbx.Span (Rtbx.Text) Rtbx.Font.Size = 20 End Sub Q.No. 2. Answer : Private sub cmdload_Click( ) Cdb1.ShowOpen Rtbx.LoadFile (Cdb1.FileName) End Sub Q.No. 3. Answer : Private Sub cmdExit_Click() End End Sub Private Sub cmdload_Click() cdb1.ShowOpen Rtbx.LoadFile (cdb1.FileName) End Sub Private Sub cmdprn_Click() cdb1.ShowPrinter cdb1.PrinterDefault = True Dim strdatabuffer As String Dim intnoc, inti As Integer intnoc = cdb1.Copies strdatabuffer = Rtbx.Text For inti = 1 To intnoc Printer.Print strdatabuffer


Next inti Printer.EndDoc End Sub

Experiment No. 9
Group A Q. No. 2. Answer : 1. 2. 3. 4. The function of Data control is as follows : Establishes a connection to a database. Returns a set of records from the database. Enables you to move from record to record. Enables you to display and manipulate data from the records in bound controls.

Q. No. 3. Answer : MoveFirst 1. MoveFirst is the data control method. 2. It positions the control to the first record. FindFirst 1. FindFirst is a one of four Find methods. 2. It finds the first record that satisfies the find criteria. Q. No. 4. Answer : A recordset consists of rows and columns similar to tables, but it can contains data from multiple tables. The RecordSet are of three types : 1. DynaSet- Updated every time user changes the database which in turn reflects in table. 2. SnapShot - Records can not be updated, it is static in nature. 3. Table It repesents individual reference database. Group B Q.No. 1. Answer : Private Sub cmd70per_Click() Data1.RecordSource = "select * from dao1 where Marks >70" End Sub Private Sub cmdAdd_Click() Data1.Recordset.AddNew End Sub Private Sub cmdedit_Click() Data1.Recordset.Edit


End Sub Private Sub cmdelete_Click() Data1.Recordset.Delete End Sub Private Sub cmdexit_Click() End End Sub Private Sub cmdfind_Click() Data1.Recordset.FindFirst "Student_Name=""&trim(txtsearch.Text)&""" End Sub Private Sub cmdfirst_Click() Data1.Recordset.MoveFirst End Sub Private Sub cmdlast_Click() Data1.Recordset.MoveLast End Sub Private Sub cmdnxt_Click() Data1.Recordset.MoveNext If Data1.Recordset.EOF Then Data1.Recordset.MoveFirst End Sub Private Sub cmdprv_Click() Data1.Recordset.MovePrevious If Data1.Recordset.BOF Then Data1.Recordset.MoveLast End Sub Private Sub cmdRefresh_Click() Data1.Refresh End Sub Private Sub cmdUpdate_Click() Data1.Recordset.Update End Sub


Experiment No. 10
Q.No. 1. Answer : Private Sub TabStrip1_Click() If TabStrip1.SelectedItem.Index = 1 Then StatusBar1.Panels(1).Text = Sqr(Val(Text1.Text)) End if End Sub Q. No. 2. Answer : Private Sub cmdprogchk_Click() Timer1.Enabled = True ProgressBar1.Value = 0 End Sub Private Sub Form_Load() Timer1.Enabled = False ProgressBar1.Value = 0 End Sub Private Sub Timer1_Timer() ProgressBar1.Value = ProgressBar1.Value + 10 If ProgressBar1.Value >= 70 Then Timer1.Enabled = False MsgBox "70% file is copied" End If End Sub

Q. No. 3. Answer : Private Sub Form_Load() Dim listitem1 As ListItem Set listitem1 = ListView1.ListItems.Add listitem1.Text = "Pranav" ListView1.ListItems(1).ListSubItems.Add , , "85" ListView1.View = 3 End Sub

Q. No. 4. Answer :


Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) If Button.Index = 1 Then StatusBar1.Panels(1) = "Addition " & Val(Text1.Text) + Val(Text2.Text) ElseIf Button.Index = 2 Then StatusBar1.Panels(1) = "Subtraction " & Val(Text1.Text) - Val(Text2.Text) End If End Sub

Q. No. 5. Answer : Private Sub Timer1_Timer() Dim i, j As variant For i = 1 To 6 For j = 10000 To 999999 Step 100 / 2 Picture1.Picture = ImageList1.ListImages(i).Picture Next j Next i End Sub