thanx all for your help..but as i mentioned i have no background using visual basic..
i'm copying the whole program here..and can u modify it and post it here as a full program plz
Private Sub Command1_Click()
If Len(txt.Text) > 7 Then
MsgBox "Length should be 7 Numbers At Maximum", vbCritical
txt.SetFocus
Exit Sub
End If
If IsNumeric(txt.Text) Then
MsgBox "You Should Enter Roman Numbers Only", vbCritical
Exit Sub
End If
Dim arr(7) As Integer
Dim namex(6) As String
namex(0) = "I"
namex(1) = "V"
namex(2) = "X"
namex(3) = "L"
namex(4) = "C"
namex(5) = "D"
namex(6) = "M"
Dim d, i, l, j As Integer
l = Len(txt.Text)
Dim pos As Integer
pos = 0
Dim count As Integer
count = 0
'checking for the first letter
For i = 1 To l
pos = InStr(i, txt.Text, namex(0))
If pos > 0 Then
arr(pos - 1) = 1
count = count + 1
End If
Next
'check for repeats of the letter
If count > 4 Then
MsgBox "A Roman Number Is Repeated More Than Enough", vbCritical
Exit Sub
End If
count = 0
'checking for the 2nd letter
pos = 1
For i = 1 To l
pos = InStr(i, txt.Text, namex(1))
If pos > 0 Then
arr(pos - 1) = 5
count = count + 1
End If
Next
'check for repeats of the letter
If count > 1 Then
MsgBox "A Roman Number Is Repeated More Than Enough", vbCritical
Exit Sub
End If
count = 0
'checking for the 3rd letter
pos = 1
For i = 1 To l
pos = InStr(i, txt.Text, namex(2))
If pos > 0 Then
arr(pos - 1) = 10
count = count + 1
End If
Next
'check for repeats of the letter
If count > 4 Then
MsgBox "A Roman Number Is Repeated More Than Enough", vbCritical
Exit Sub
End If
count = 0
'checking for the 4th letter
pos = 1
For i = 1 To l
pos = InStr(i, txt.Text, namex(3))
If pos > 0 Then
arr(pos - 1) = 50
count = count + 1
End If
Next
'check for repeats of the letter
If count > 1 Then
MsgBox "A Roman Number Is Repeated More Than Enough", vbCritical
Exit Sub
End If
count = 0
'checking for the 5th letter
pos = 1
For i = 1 To l
pos = InStr(i, txt.Text, namex(4))
If pos > 0 Then
arr(pos - 1) = 100
count = count + 1
End If
Next
'check for repeats of the letter
If count > 4 Then
MsgBox "A Roman Number Is Repeated More Than Enough", vbCritical
Exit Sub
End If
count = 0
'checking for the 6th letter
pos = 1
For i = 1 To l
pos = InStr(i, txt.Text, namex(5))
If pos > 0 Then
arr(pos - 1) = 500
count = count + 1
End If
Next
'check for repeats of the letter
If count > 2 Then
MsgBox "A Roman Number Is Repeated More Than Enough", vbCritical
Exit Sub
End If
count = 0
'checking for the 7th letter
pos = 1
For i = 1 To l
pos = InStr(i, txt.Text, namex(6))
If pos > 0 Then
arr(pos - 1) = 1000
count = count + 1
End If
Next
'check for repeats of the letter
If count > 7 Then
MsgBox "A Roman Number Is Repeated More Than Enough", vbCritical
Exit Sub
End If
count = 0
'check for invalid chars
For j = 0 To l - 1
If arr(j) = 20 Then
MsgBox "Invalid characheters", vbCritical
Exit Sub
End If
Next
'check for decreasing order in the array
For i = 0 To l - 1
If Int(arr(i)) < Int(arr(i + 1)) And Not i >= l - 1 Then
MsgBox "Roman Numbers Should Be In Decreasing Order"
'Exit Sub
End If
Next
'print the array to the list
For i = 0 To l - 1
List1.AddItem arr(i)
Next
' print the total
Dim total As Integer
total = 0
For i = 0 To l - 1
total = total + arr(i)
Next
Label1.Caption = total
End Sub