Reputation: 43
The message box should display "The sum of the numbers 1 through 10 is 55." So I have to put two variables in a message box. like this one
MessageBox.Show("Sum of Numbers", "The sum of numbers 1 through " & intUserInput.ToString, " is " & dblTotal.ToString, MessageBoxButtons.OK)
but I'm getting an error - "Overload resolution failed because no accessible 'Show' can be called with these arguments"
Not sure if I understands why.
Upvotes: 0
Views: 1075
Reputation: 53
You have an extra comma after ToString: intUserInput.ToString, " is "
Upvotes: 1
Reputation: 4808
You have a typo in your string concatenation - try the below
MessageBox.Show("The sum of numbers 1 through " & intUserInput.ToString & " is " & dblTotal.ToString, "Sum of Numbers", MessageBoxButtons.OK)
There was a comma after the intUserInput.ToString
portion, which looked like a new parameter argument.
Upvotes: 3