4/11/10

visual basic programs for BCA 3 and BSC(C.S) and ENGG students.

animation control.


Dim flag As IntegerPrivate Sub Command1_Click()Animation1.Open "c:\search.avi"flag = 1End Sub
Private Sub Command2_Click()If flag = 1 ThenAnimation1.AutoPlay = TrueElseMsgBox "please press open button"End IfEnd Sub
Private Sub Command3_Click()
Animation1.CloseEnd Sub
Private Sub Command4_Click()
EndEnd Sub



simple example for ms excess DATABASE.

Private Sub Command1_Click()Data1.Recordset.MoveNextIf (Data1.Recordset.EOF) ThenMsgBox " end of file"Data1.Recordset.MoveFirst
End IfEnd Sub
Private Sub Command2_Click()Data1.Recordset.Delete
End Sub
Private Sub Command3_Click()Data1.Recordset.AddNew'Data1.Recordset.MovePrevious
End Sub


CHANGING FONT STYLE....

Private Sub Combo1_Click()Text1.FontSize = Combo1.TextEnd Sub
Private Sub Combo2_Click()Text1.FontName = Combo2.Text
End Sub
Private Sub Combo3_Click()If (Combo3.Text = "bold") ThenText1.FontBold = TrueText1.FontItalic = FalseText1.FontStrikethru = FalseText1.FontUnderline = FalseEnd If
If (Combo3.Text = "italic") ThenText1.FontBold = FalseText1.FontItalic = TrueText1.FontStrikethru = FalseText1.FontUnderline = FalseEnd If
If (Combo3.Text = "strikethru") ThenText1.FontBold = FalseText1.FontItalic = FalseText1.FontStrikethru = TrueText1.FontUnderline = FalseEnd IfIf (Combo3.Text = "underlined") ThenText1.FontBold = FalseText1.FontItalic = FalseText1.FontStrikethru = FalseText1.FontUnderline = TrueEnd IfEnd Sub
Private Sub Form_Load()Combo1.AddItem "8"Combo1.AddItem "16"Combo1.AddItem "20"Combo1.AddItem "26"Combo2.AddItem "ms sans serif"Combo2.AddItem "arial"Combo2.AddItem "modern"Combo2.AddItem "impact"Combo3.AddItem "bold"Combo3.AddItem "italic"Combo3.AddItem "strikethru"Combo3.AddItem "underlined"


NUMBER TO TEXT PROGRAM....

Private Sub Command1_Click()Dim x As IntegerDim t As IntegerDim h As IntegerDim tn As IntegerDim w(19) As StringDim m(10) As StringDim s As Stringx = Val(Text1.Text)'ch = n - tn * 10w(1) = "one"w(2) = "two"w(3) = "three"w(4) = "four"w(5) = "five"w(6) = "six"w(7) = "seven"w(8) = "eight"w(9) = "nine"w(10) = "ten"w(11) = "eleven"w(12) = "twelve"w(13) = "thirteen"w(14) = "forteen"w(15) = "fifteen"w(16) = "sixteen"w(17) = "seventeen"w(18) = "eighteen"w(19) = "ninteen"m(1) = "ten"m(2) = "twenty"m(3) = "thirty"m(4) = "forty"m(5) = "fifty"m(6) = "sixty"m(7) = "seventy"m(8) = "eighty"m(9) = "ninety"t = Int(x / 1000)x = x - (t * 1000)h = Int(x / 100)x = x - (h * 100)tn = Int(x / 10)x = x - (tn * 10)If (t >= 1) And (t <= 19) Thens = s + w(t) + "thousand"End IfIf (t >= 20) Thens = s + m(t) + "thounsand"End IfIf (h >= 1) Thens = s + w(h) + "hundred"End IfIf (tn > 1) Thens = s + m(tn)ElseIf (tn = 1) Thens = s + w(x + 10)GoTo display
End IfIf (x >= 1) Thens = s + w(x) + "only"End Ifdisplay:Text2.Text = sEnd Sub
Private Sub Form_Load()Text1.Text = ""Text2.Text = ""
End Sub

No comments:

Post a Comment