Public Class FrmDuplicateElimination
Private Sub TxtEnter_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtEnter.TextChanged
If (IsNumeric(TxtEnter.Text)) Then
Else
MessageBox.Show = "Enter Only Numeric Values !"
Exit Sub
End If
End Sub
For the second part of my question My TxtEnter is not entering a value into the LstBxNmbrEntered am I to string this to the LstBxNmbrEntered? My assignment to create a single array using only the numbers between 10 and 100 - (20 numbers only) eliminating duplicates. I have looked at other homework on here, and have gone back to my own code to perfect it instead of useing others codes. Thanks
Private Sub FrmDuplicateElimination_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim txtEnter(20) As Integer
Dim LstBxNmbrEntered As Integer
Dim unique_numbersArray As Integer
Dim result() As String
' Make the result array.
ReDim result(0 To UBound(txtEnter))
' Copy the first item into the result array.
result(1) = txtEnter(0)
' Copy the other items
unique_numbersArray = 1
For LstBxNmbrEntered = 2 To UBound(txtEnter)
If result(unique_numbersArray) <> txtEnter(LstBxNmbrEntered) Then
unique_numbersArray = unique_numbersArray + 1
result(unique_numbersArray) = txtEnter(LstBxNmbrEntered)
End If
Next LstBxNmbrEntered
' Remove unused entries from the result array.
ReDim Preserve result(0 To unique_numbersArray)
' Return the result array.
'RemoveDups = result
End Sub
Private Sub BtnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClear.Click
LstBxNmbrEntered.Items.Clear() ' clear numbersEnteredListBox
LstBxunique_numbersArray.Text = String.Empty ' clear Label
End Sub
End Class
I believe I may have posted this in the wrong forum? This could possibly be a vb.net issue or can it be solved in vb6?

New Topic/Question
Reply



MultiQuote




|