1
Answer

Argument not specified

denise.gagneur

denise.gagneur

20y
3.2k
1
Am I allowed to ask for homework help on this site without being locked out? If not, please don't lock me out of the site without letting me know that homework questions are not exceptable. If so, here is my issue: I put in the time and have written my code and tried to figure out the problem myself but keep coming up with the error below. Argument not specified for parameter 'intNum' of 'Private Function GetRandomNum(intNum As Integer) As Object'. I am trying to create a function to generate random numbers from the numbers supplied in two listboxes. Here is a sample of my code: Dim intl, intu As Integer Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load For intl = 1 To 100 Step 1 Me.lowerListBox.Items.Add(intl) Next intl For intu = 10 To 1000 Step 10 Me.upperlistbox.Items.Add(intu) Next intu End Sub Private Function GetRandomNum(ByVal intNum As Integer) ' Dim intNum As Integer Dim intupper As Integer Dim intlower As Integer intupper = Me.lowerListBox.SelectedIndex intlower = Me.upperlistbox.SelectedIndex If lowerListBox.SelectedIndex = True Then If upperlistbox.SelectedIndex = True Then intNum = Int((intupper - intlower + 1) * Rnd() + intlower) Return intNum Me.txtRandomNumber.Text = intNum End If End If End Function Private Sub lowerListBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lowerListBox.SelectedIndexChanged Call GetRandomNum() End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click Me.Close() End Sub End Class Thanks!!
Answers (1)