Escolar Documentos
Profissional Documentos
Cultura Documentos
Part -B Programs
12. Create a VB Application to change the color of the text in a text box use scroll
bar for the selection of colors
14.VB Application to write into a Binary File and To Read from a binary File
16.Write a VB program to Load an image using Drive list box, file list box and
directory list box.
End
End Sub
Adodc1.RecordSource = "select * from booktable where title ='" & txtsearchstring.Text & "'"
Adodc1.RecordSource = "select * from booktable where author='" & txtsearchstring.Text & "'"
Else
End If
DataGrid1.Refresh
Adodc1.Refresh
End Sub
Part-B
13. Write a VB Application to demonstrate parameter passing
Private Sub Cmdbyvalue_Click()
value = Val(Text1.Text)
Text2.Text = value
End Sub
test = 20
End Sub
test = 20
End Sub
value = Val(Text1.Text)
Text2.Text = value
End Sub
Part-B
15. Write a VB program to Encrypt and Decrypt a string.
Private Sub Command1_Click()
End Sub
For v = 1 To Len(Name)
c1 = Asc(Mid(Name, v, 1))
c1 = Chr(c1 + Key)
z = z & c1
Next v
Encrypt = z
End Function
End Sub
For v = 1 To Len(Name)
c1 = Asc(Mid(Name, v, 1))
c1 = Chr(c1 - Key)
z = z & c1
Next v
Decrypt = z
End Function
Part-B
16. Write a VB program to Load an image using Drive list box, file
list box and directory list box.
End
End Sub
File1.Path = Dir1.Path
End Sub
Dir1.Path = Drive1.Drive
End Sub
End Sub
File1.Pattern = "*.jpg;*.bmp;*.gif"
End Sub
Part- B
Dim id As Integer
Adodc1.Refresh
Adodc1.Recordset.MoveLast
id = Adodc1.Recordset("ROLL_NO") + 1
Adodc1.Recordset.AddNew
Text1.Text = id
Text2.SetFocus
Exit Sub
errmsg:
Adodc1.Recordset.AddNew
Text1.Text = 1
Text2.SetFocus
End Sub
Adodc1.Recordset.Update
Exit Sub
errmsg:
MsgBox "Duplicate Item id"
Adodc1.Recordset.CancelUpdate
End Sub
Text1.Enabled = False
student_Name = Text2.Text
Adodc1.Recordset.Update
End Sub
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
Text1.Text = ""
Text2.Text = ""
Exit Sub
errmsg:
MsgBox "error"
End Sub
Adodc1.Recordset.MoveFirst
Exit Sub
errmsg:
End Sub
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
End If
End Sub
If Adodc1.Recordset.BOF Then
End If
Adodc1.Recordset.MovePrevious
End Sub
Adodc1.Recordset.MoveLast
Exit Sub
errmsg:
MsgBox "Item list is empty"
End Sub
Adodc1.Refresh
End Sub