Hi

(I meant to say list box in the title heading, not combo box. Can't edit the title)

I am trying to create a unit converter program. At the moment I'm trying to populate my combo box with results that have been calculated. I have two sets of results to display. I want them displayed side by side and have been trying very hard to do this. So far I've managed to get the result to display but only the original unit, it's start, increment and end value. Not the converted unit, start, increment and end value.

Then I managed to display both the original inputs and the converted inputs but they were showing directly below one another instead of being seperated into two seperate columns, i.e. original input, start, increment and end and the converted unit, start, increment etc.

This is the code snippet I am working with:

lstTableResult.Text = "" + (FormatNumber(lcInputValue, CInt(mdDecPlaces))), "" + (FormatNumber(lcResult, CInt(mdDecPlaces)))

The code above is incorrect and shows errors, i.e. is asking for end of statement.

The code below works, but it is only one code line, I've just split into two to make it work... not what I actually want.

lstTableResult.Items.Add(FormatNumber(lcInputValue, CInt(mdDecPlaces)))
lstTableResult.Items.Add(FormatNumber(lcResult, CInt(mdDecPlaces)))

Any assistance would be appreciated.

Also, I can add more info if needed.

From what I understand you want to loop for the following results

i.e. original input, start, increment and end and the converted unit, start, increment etc.

Just clarify to me you want 4 lines per operations correct?

Hi, I have the loop sorted I think, it's just displaying the results correctly that I am having trouble with. I want it to display as below using decimal places and as columns.

Feet Metres
5 1.524
10 3.048
15 4.572
20 6.096

Does that make sense?

whoops, I seperated the two as columns but the post has not shown it correctly.

Try this

Add // and say which value is input which value is increment, etc.

I don't understand your logic.

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.