Hello, I have a problem with c++ windows form. I read a number of elements from first textbox and from second I have to read a height of these elements (i.e. n=5, heights = 150, 160, 170, 180, 190). I made it first in console app and works perfect, but there's a problem with form app..any ideas?

Recommended Answers

All 4 Replies

Yes firstly don't have a text box for number it is entirely superfluous when you can just design the interface so the user can enter any number of values and the software can read that number later.

Use a list box, a text box and a button labeled "Add". When the user enters a value in the text box and hits add read the text box and put the value into the list box (and may be clear the text box). Have a second button (labeled 'OK') which the user can hit when they have finished entering values to process all the values in the list box.

For a brucy bonus included a 'Remove' button to allow the user to remove erroneous values from the list box.

thx, but how I can add an array of numbers from textbox to listbox? i tried with listBox1->Text = textBox1->Text; but it doesn't works

You will have to do it in a loop and parse all the characters in the textbox. I assume from your description that the textbox holds all 5 numbers at the same time. If you don't know how to do that then maybe you should take some time to study loops.

Take a look at this thread. It may be of some use to you.

Be a part of the DaniWeb community

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