lblb.Caption = hsb.Value txtb.BackColor = RGB(0, 0, hsb.Value) txt.BackColor = RGB(hsr.Value, hsg.Value, hsb.Value) End Sub
Private Sub hsg_Change()
lblg.Caption = hsg.Value txtg.BackColor = RGB(0, hsg.Value, 0) txt.BackColor = RGB(hsr.Value, hsg.Value, hsb.Value) End Sub
Private Sub hsr_Change()
lblr.Caption = hsr.Value txtr.BackColor = RGB(hsr.Value, 0, 0) txt.BackColor = RGB(hsr.Value, hsg.Value, hsb.Value) End Sub Output LOADING A PICTURE USING FILE CONTROLS
Private Sub Dir1_Change()
File1.Path = Dir1.Path File1.Pattern = "*.bmp;*.jpg;*.ico;*.gif" End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive End Sub
Private Sub File1_Click()
pict.Picture = LoadPicture(File1.Path & "\" & File1.FileName) End Sub
Private Sub Form_Load()
pict.Visible = False End Sub
Private Sub opthide_Click()
pict.Visible = False End Sub
Private Sub optshow_Click()
pict.Visible = True End Sub Output DESIGNING A CALCULATOR
Dim op1, op2 As Single
Dim opr As String
Private Sub cmd_Click(Index As Integer)
If txt.Text = "0" Then txt.Text = "" txt = txt + cmd(Index).Caption End Sub
Private Sub cmdadd_Click()
op1 = Val(txt.Text) opr = "+" txt = "" End Sub
Private Sub cmddiv_Click()
op1 = Val(txt.Text) opr = "/" txt = "" End Sub
Private Sub cmddot_Click()
If InStr(txt, ".") Then Else txt = txt + "." End If End Sub Private Sub cmdeql_Click() op2 = Val(txt.Text) txt = "" Select Case opr Case "+": txt = op1 + op2 Case "-": txt = op1 - op2 Case "*": txt = op1 * op2 Case "/": txt = op1 / op2 End Select End Sub
Private Sub cmdplusminus_Click()
txt.Text = -Val(txt.Text) End Sub
Private Sub cmdmul_Click()
op1 = Val(txt.Text) opr = "*" txt = "" End Sub
Private Sub cmdoff_Click()
txt.Enabled = False txt = "" End Sub
Private Sub cmdon_Click()
txt.Enabled = True op1 = 0 txt = "0" End Sub Private Sub cmdrev_Click() txt = 1 / Val(txt.Text) End Sub
Private Sub cmdsqr_Click()
txt = Val(txt.Text) * Val(txt.Text) End Sub
Private Sub cmdsub_Click()
op1 = Val(txt.Text) opr = "-" txt = "" End Sub
Private Sub Form_Load()
txt.Enabled = False End Sub Output MDI APPLICATION FOR TILE AND CASCADE CHILD FORMS
Dim n(2) As New Form5
Dim i%
Private Sub mnucas_Click()
MDIForm1.Arrange (0) End Sub
Private Sub mnuclose_Click()
For i = 0 To 2 Unload n(i) Next i End Sub
Private Sub mnuexit_Click()
End End Sub
Private Sub mnuhor_Click()
MDIForm1.Arrange (1) End Sub
Private Sub mnunew_Click()
For i = 0 To 2 n(i).Show Next i End Sub
Private Sub mnuver_Click()
MDIForm1.Arrange (2) End Sub Output
Horizontal Vertical Cascade FORMATTING A TEXT
Private Sub chkst_Click()
If chkst.Value = 1 Then txt.FontStrikethru = True Else txt.FontStrikethru = False End If End Sub
Private Sub chkul_Click()
If chkul.Value = 1 Then txt.FontUnderline = True Else txt.FontUnderline = False End If End Sub
Private Sub cmdend_Click()
End End Sub
Private Sub Form_Load()
lstfname.Clear lstfsize.Clear For i = 0 To Screen.FontCount - 1 lstfname.AddItem Screen.Fonts(i) Next i For i = 8 To 50 Step 2 lstfsize.AddItem (i) Next i End Sub Private Sub lstfname_Click() txt.FontName = lstfname.Text End Sub
Private Sub lstfsize_Click()
txt.FontSize = Val(lstfsize.Text) End Sub
Private Sub lstfstyle_Click()
If lstfstyle.Text = "Bold" Then txt.FontItalic = False txt.FontBold = True ElseIf lstfstyle.Text = "Italic" Then txt.FontBold = False txt.FontItalic = True ElseIf lstfstyle.Text = "BoldItalic" Then txt.FontBold = True txt.FontItalic = True Else txt.FontBold = False txt.FontItalic = False End If End Sub
Private Sub optcenter_Click()
txt.Alignment = 2 End Sub
Private Sub optleft_Click()
txt.Alignment = 0 End Sub
Private Sub optright_Click()
txt.Alignment = 1 End Sub Output DESIGNING A TEXT USING MENU EDITOR
Dim s As String
Private Sub Form_Load()
rt.Visible = False End Sub
Private Sub mnucopy_Click()
s = rt.SelText End Sub
Private Sub mnucut_Click()
s = rt.SelText rt.SelText = "" End Sub
Private Sub mnuexit_Click()
End End Sub
Private Sub mnunew_Click()
rt.Text = "" rt.Visible = True End Sub
Private Sub mnusave_Click()
cd.Action = 2 rt.SaveFile cd.FileName End Sub Private Sub mnuopen_Click() cd.Filter = "rtf files|*.rtf|text files|*.txt|" cd.Action = 1 rt.Visible = True rt.LoadFile cd.FileName openfile = cd.FileName End Sub
Private Sub mnupaste_Click()
rt.SelText = s End Sub Output
Saving new document
Opening a document Opening the selected file in our form Designing Database Application
Opening Visual Data Manager using Add-Ins/Visual Data Manager
Creating a database Creating a table Building the table Entering records in the table Output