add handler

lekner
01-10-2005, 03:51 PM
i created some arreys of textboxes you can email any time (lekner@bezeqint.net)
i created an textchaged method for one of them but i dont know how to name that method that i will be able to add more methods from the same group beacuse i created a method that the user will not be able to insert any
data if its not a number
very nice method .

here is one sample of what i did

AddHandler numofcbl(i).TextChanged, New EventHandler(AddressOf textchaged)

Private Sub textchaged(ByVal sender As Object, ByVal e As EventArgs)
For i = 0 To newnumber
If numofcbl(i).Text <> "" Then
len = numofcbl(i).Text.Length
checknum = Asc(numofcbl(i).Text.Substring(len - 1, 1))
If checknum < Asc(0) Or checknum > Asc(9) Then
MsgBox("only numbers please")
numofcbl(i).Text = ""
End If
End If
Next
End Sub

thank you

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum