Following the thread title, I too am having trouble populating the listbox in my unit converter.

I keep getting the error message "Conversion from string " " to type 'Integer' is not valid." when I input an accepted piece of code in VB for displaying the results in the listbox.

Here are two examples of the different pieces of code I have used to try and get the results to display.

lstTableResult.Text = (FormatNumber(CStr(lcInputValue), CInt(lcResult) + CInt(ControlChars.CrLf)))

lstTableResult(" " + FormatNumber(CInt(lcInputValue), CInt(CInt(lcResult) + CDbl(ControlChars.CrLf))))

Any help would be appreciated.

Recommended Answers

All 2 Replies

Please don't Hijack threads. and please use code tagging.

You problem is you are giving an int to a string value add ""+

Like this

lstTableResult.Text ="" + (FormatNumber(CStr(lcInputValue), CInt(lcResult) + CInt(ControlChars.CrLf)))
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.