Pages

Friday 30 March 2012

5. APPLICATION WITH MENUS


APPLICATION WITH MENUS


requirments:-

label ,text box, command button and add your liked 
open menu editior 
tools-> menu editor
to insert the menus,sub menus etc. 
now build up the table 




 coding:-

Dim a, a1 As String
Dim n As Integer
Dim x, y As String

Private Sub Form_Load()
MsgBox "welcome to vb"
End Sub

Exit:
Private Sub mnuclose_Click()
End
End Sub

Copy:
Private Sub mnucopy_Click()
a = RT1.SelText
mnucut.Enabled = False
mnucopy.Enabled = False
End Sub

Cut:
Private Sub mnucut_Click()
a = RT1.SelText
RT1.SelText = ""
mnucut.Enabled = False
mnucopy.Enabled = False
End Sub

Find:
Private Sub mnufind_Click()
a1 = InputBox ("Enter the letter to find :")
RT1.Find (a1)
n = 1
End Sub

Find next:
Private Sub mnufindnext_Click()
n = InStr (n + 1, RT1.Text, a1)
If n > 0 Then
RT1.SelStart = n - 1
RT1.SelLength = Len (a1)
RT1.SetFocus
Else
MsgBox "String not found"
End If
End Sub

Paste:
Private Sub mnupaste_Click ()
RT1.SelRTF = a
mnucut.Enabled = True
mnucopy.Enabled = True
End Sub

Replace:
Private Sub mnureplace_Click()
x = InputBox ("Enter the letter to find :")
y = InputBox ("Enter the letter to Replace :")
t = RT1.Find(x)
RT1.SelText = y
End Sub

Replace all:
Private Sub mnureplaceall_Click ()
x = InputBox ("Enter the letter to find")
y = InputBox ("Enter the letter to Replace :")
n = Len (RT1.Text)
For i = 1 To n
t = RT1.Find(x, RT1.SelStart + RT1.SelLength, n)
If t < 0 Then Exit For
RT1.SelText = y
Next i
End Sub





















OUTPUT:







0 comments

Thursday 29 March 2012

WORKING WITH DIALOG BOXES



WORKING WITH DIALOG BOXES

 requirments :
label box, text box for input
msgbox,command button 



coding:- 

Dim birthdate As Date

Calculate:

Private Sub Command1_Click()
If Not (IsDate(birthdate)) Then
MsgBox "I don't understand your date,please Retry"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Exit Sub
Else
Text3.Text = ("You have been Alive for" & Date - birthdate & "Day(s)")
End If
myDate = birthdate
myweekDay = Weekday(myDate)
Select Case myweekDay
Case 1
d = "Sunday"
Case 2
d = "Monday"
Case 3
d = "Tuesday"
Case 4
d = "Wednesday"
Case 5
d = "Thursday"
Case 6
d = "Friday"
Case 7
d = "Saturday"
End Select
Text1.Text = d
y = Year (Now) - Year (birthdate)
Text2.Text = y & "Year(s)"
MsgBox "Thankyou,Have a nice Day", vbExclamation
End Sub


End:
Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
MsgBox "Welcome to Days calclation", vbOKCancel + vbExclamation
birthdate = InputBox("Enter your date of Birth", "Date")
End Sub


OUTPUT:




0 comments

Monday 26 March 2012

WORKING WITH MULTIPLE FORMS


WORKING WITH MULTIPLE FORMS


requirments
label box, already using command buttons,text boxs, 
drive box, directory box,list box
and 3 forms order by order 

Dim f, s1 As String

File:
Private Sub Command1_Click()
fn = File1.FileName
s1 = Right(fn, 4)
If s1 = ".jpg" Or s1 = ".gif" Or s1 = ".JPG" Or s1 = ".GIF" Or s1 = ".bmp" Then
Load Form2
Form2.Show
Form2.Image1.Picture = LoadPicture(Form1.File1.Path & "\" & Form1.File1.FileName)
Else
Load Form5
Form5.Show
Form5.OLE1.CreateLink (Form1.File1.Path & "\" & Form1.File1.FileName)
End If
End Sub

Clear:
Private Sub Command2_Click()
Drive1.ListIndex = -1
Dir1.ListIndex = -1
File1.ListIndex = -1
End Sub

Exit:
Private Sub Command3_Click()
End
End Sub

Directory:
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Drive:
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub







OUTPUT:









0 comments

Friday 23 March 2012

WORKING WITH INTRINSIC CONTROL (lear vb lesson 2)


WORKING WITH INTRINSIC CONTROL

requirments:-
* text box, label box, frame,command button 
 coding:


Private Sub Calendar1_Click ()
Text4.Text = Calendar1.Value
End Sub

Clear:
Private Sub Command1_Click ()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Check1.Visible = False
Check2.Visible = False
Option1.Value = False
Option2.Value = False
Option3.Value = False
End Sub

Exit:
Private Sub Command2_Click ()
End
End Sub

Status:
Private Sub Text5_Click()
If Text3.Text >= 70 And Text3.Text <= 100 Then
If Option1.Value = True Or Option2.Value = True Or Option3.Value = True Then
Text5.Text = "Admited"
Else
Text5.Text = "Not Admied"
End If
ElseIf Text3.Text >= 60 And Text3.Text < 75 Then
If Option2.Value = True Or Option3.Value = True Then
Text5.Text = "Admitted"
Else
Text5.Text = "Not Admitted"
End If
ElseIf Text3.Text >= 50 And Text3.Text < 60 Then
If Option3.Value = True Then
Text5.Text = "Admitted"
Else
Text5.Text = "Not Admited"
End If
ElseIf Text3.Text <= 50 Then
Text5.Text = "Not Admitted"
End If
End Sub




output 


0 comments

Thursday 22 March 2012

learn vb 6.0 step by step. SIMPLE CALCULATOR



SIMPLE CALCULATOR

CODING : 

Dim d As Double
Dim i As Integer
Dim s As String


Private Sub Command1_Click(Index As Integer)
Image2.Enabled = True
Select Case Index
Case 0
Text1.Enabled = True
Text1.SetFocus
For i = 1 To 26
Command1(i).Enabled = True
Next i
Command1(0).Enabled = False
Case 1
End
Case 2
Text1.Text = ""
Text1.SetFocus
Case 3 To 13
Text1.Text = Text1.Text + (Command1 (Index).Caption)
Case 14 To 17
d = Text1.Text
Text1.Text = ""
s = Command1(Index).Caption
Case 18
If s = "+" Then
Text1.Text = Val(d) + Val (Text1.Text)
ElseIf s = "-" Then
Text1.Text = Val(d) - Val(Text1.Text)
ElseIf s = "*" Then
Text1.Text = Val(d) * Val (Text1.Text)
ElseIf s = "/" Then
Text1.Text = Val (d) / Val (Text1.Text)
End If
Case 19
Text1.Text = Round(Sin((Text1.Text) * 3.14 / 180), 2)
Case 20
Text1.Text = Round(Cos((Text1.Text) * 3.14 / 180), 2)
Case 21
If Text1.Text = 90 Then
Text1.Text = "Infinite"
Else
Text1.Text = Round(Tan((Text1.Text) * 3.14 / 180), 2)
End If

Case 22
Text1.Text = Log(Text1.Text) / Log(10)
Case 23
Text1.Text = Sqr(Text1.Text)
Case 24
Text1.Text = Text1.Text * Text1.Text
Case 25
Text1.Text = 1 / Text1.Text
Case 26
Text1.Text = Text1.Text / 100
End Select
End Sub



Private Sub Form_Load()
For i = 1 To 26
Command1(i).Enabled = False
Next i
Text1.Enabled = True
End Sub































OUTPUT:




0 comments

Tuesday 21 February 2012

e1732 phone does not answer? done here .charges apply!

modem unalock ? phone dos not answer?
hi unalock modem problem?  phone does not answer?  netsetter e1732 e155 all unalock modem problems?

done here dont feel. charges apply. contact  +918428489561  ( for tamilnadu users) other state users contact via Email: dinesh_18@in.com
0 comments

Friday 3 February 2012

welcome

welcome to all 
0 comments

would u like this?

Chitika