Dim i As
Integer
Dim str As String
Private Sub CmdASC_Click()
i = Asc(Txtnum1.Text)
MsgBox "asc value is: " & i
End Sub
Private Sub CmdCHR_Click()
str = Chr(Val(Txtnum1.Text))
MsgBox "chr code is: " & str
End Sub
Dim str As String
Private Sub CmdASC_Click()
i = Asc(Txtnum1.Text)
MsgBox "asc value is: " & i
End Sub
Private Sub CmdCHR_Click()
str = Chr(Val(Txtnum1.Text))
MsgBox "chr code is: " & str
End Sub
Private Sub
CmdLcase_Click()
str = LCase(Txtnum1.Text)
MsgBox "lower case text is: " & str
End Sub
str = LCase(Txtnum1.Text)
MsgBox "lower case text is: " & str
End Sub
Private Sub
CmdUcase_Click()
str = UCase(Txtnum1.Text)
MsgBox "upper case text is: " & str
End Sub
str = UCase(Txtnum1.Text)
MsgBox "upper case text is: " & str
End Sub
Private Sub
CmdLEN_Click()
i = Len(Txtnum1.Text)
MsgBox "length is: " & i
End Sub
i = Len(Txtnum1.Text)
MsgBox "length is: " & i
End Sub
Private Sub
CmdLeft_Click()
Dim size As Integer
size = InputBox("enter size: ")
str = Left(Txtnum1.Text, size)
MsgBox "left part of string is: " & str
End Sub
Dim size As Integer
size = InputBox("enter size: ")
str = Left(Txtnum1.Text, size)
MsgBox "left part of string is: " & str
End Sub
Private Sub
Cmdright_Click()
Dim size As Integer
size = InputBox("enter size: ")
str = Right(Txtnum1.Text, size)
MsgBox "right part of string is: " & str
End Sub
Private Sub CmdMID_Click()
Dim start, size As Integer
start = InputBox("enter starting point: ")
size = InputBox("enter size: ")
str = Mid(Txtnum1.Text, start, size)
MsgBox "mid part of string is: " & str
End Sub
Dim size As Integer
size = InputBox("enter size: ")
str = Right(Txtnum1.Text, size)
MsgBox "right part of string is: " & str
End Sub
Private Sub CmdMID_Click()
Dim start, size As Integer
start = InputBox("enter starting point: ")
size = InputBox("enter size: ")
str = Mid(Txtnum1.Text, start, size)
MsgBox "mid part of string is: " & str
End Sub
Private Sub
CmdTRIM_Click()
str = Trim(Txtnum1.Text)
MsgBox "string is:" & str
End Sub
str = Trim(Txtnum1.Text)
MsgBox "string is:" & str
End Sub
Private Sub
CmdLtrim_Click()
str = LTrim(Txtnum1.Text)
MsgBox "string is: " & Txtnum1.Text
MsgBox "after trim string is:" & str
End Sub
str = LTrim(Txtnum1.Text)
MsgBox "string is: " & Txtnum1.Text
MsgBox "after trim string is:" & str
End Sub
Private Sub
CmdRtrim_Click()
str = RTrim(Txtnum1.Text)
MsgBox "string is: " & Txtnum1.Text
MsgBox "after trim string is:" & str
End Sub
str = RTrim(Txtnum1.Text)
MsgBox "string is: " & Txtnum1.Text
MsgBox "after trim string is:" & str
End Sub
Private Sub
CmdInstr_Click()
i = InStr(1, Txtnum1.Text, Txtnum2.Text, vbBinaryCompare)
MsgBox "string found at pos: " & i
End Sub
i = InStr(1, Txtnum1.Text, Txtnum2.Text, vbBinaryCompare)
MsgBox "string found at pos: " & i
End Sub
Private Sub
CmdSpace_Click()
MsgBox Txtnum1.Text & Space(10) & Txtnum2.Text
End Sub
MsgBox Txtnum1.Text & Space(10) & Txtnum2.Text
End Sub
Private Sub
CmdStrcomp_Click()
i = StrComp(Txtnum1.Text, Txtnum2.Text, vbBinaryCompare)
MsgBox i
End Sub
i = StrComp(Txtnum1.Text, Txtnum2.Text, vbBinaryCompare)
MsgBox i
End Sub
Private Sub
CmdString_Click()
str = String(15, "#")
MsgBox str
End Sub
Private Sub CmdABS_Click()
i = Abs(Val(Txtnum1.Text))
MsgBox "absolute value is: " & i
End Sub
str = String(15, "#")
MsgBox str
End Sub
Private Sub CmdABS_Click()
i = Abs(Val(Txtnum1.Text))
MsgBox "absolute value is: " & i
End Sub
Private Sub
CmdEXP_Click()
Dim e As Double
e = Exp(Val(Txtnum1.Text))
MsgBox "exponent value is: " & e
End Sub
Dim e As Double
e = Exp(Val(Txtnum1.Text))
MsgBox "exponent value is: " & e
End Sub
Private Sub
CmdINT_Click()
i = Int(Val(Txtnum1.Text))
MsgBox "integer value is: " & i
End Sub
i = Int(Val(Txtnum1.Text))
MsgBox "integer value is: " & i
End Sub
Private Sub
CmdFIX_Click()
i = Fix(Val(Txtnum1.Text))
MsgBox "fix value is: " & i
End Sub
i = Fix(Val(Txtnum1.Text))
MsgBox "fix value is: " & i
End Sub
Private Sub
CmdLOG_Click()
Dim l As Double
l = Log(Val(Txtnum1.Text))
MsgBox "logarithm value is: " & l
End Sub
Private Sub CmdRnd_click()
For i = 1 To 5
i = 10 * Rnd
MsgBox i
Next
End Sub
Dim l As Double
l = Log(Val(Txtnum1.Text))
MsgBox "logarithm value is: " & l
End Sub
Private Sub CmdRnd_click()
For i = 1 To 5
i = 10 * Rnd
MsgBox i
Next
End Sub
Private Sub
CmdSGN_Click()
i = Sgn(Val(Txtnum1.Text))
MsgBox "sgn value is: " & i
End Sub
i = Sgn(Val(Txtnum1.Text))
MsgBox "sgn value is: " & i
End Sub
Private Sub
CmdSQR_Click()
i = Sqr(Val(Txtnum1.Text))
MsgBox "square value is: " & i
End Sub
Private Sub CmdVAL_Click()
MsgBox ("This is no " & Val(Txtnum1.Text))
End Sub
Private Sub CmdExit_click()
End
End Sub
i = Sqr(Val(Txtnum1.Text))
MsgBox "square value is: " & i
End Sub
Private Sub CmdVAL_Click()
MsgBox ("This is no " & Val(Txtnum1.Text))
End Sub
Private Sub CmdExit_click()
End
End Sub
Output
Note:- Please set some property of your control like caption
or id corresponding to your control
Goto Visual Basic Programs Index Page