What do you mean by split? Do you want data in two columns like a table for example:
If so, add a ListView to your form then in the load event of your form add the following code (and read the comments to see what is happening):
// Set the ListView to Details view (the listview supports large icons, small icons, list)
// in exactly the same way as Windows Explorer does. In the case of splitting data we want
// a Details view so that we can have columns.
listView1.View = View.Details;
// Add 2 columns to the list view. This can be done in the properties of the list view
// look at the Columns property, or code as we are doing here.
// Now we will add some data. I'm just using a loop to show how data will be represented
// Data + i is added as the main item - the first column - and sub item + i is added as
// an additional item.
// There are other methods for adding items but this is just an example.
for (int i = 0; i < 10; i++)
listView1.Items.Add("Data " + i.ToString()).SubItems.Add("Sub item " + i.ToString());
Or else use the multicolumn property of the listbox.
I agree with the DataGridView as an alternative but I'm not sure about the MultiColumn property of a list box as this is used to negate the need to scroll vertically. You also have no control over how many columns are created as this is totally dependant on the data added to the list box.
Also, there are no column headers, so unless you know the actual width that you will need, some data may be truncated (or hidden) and the user will not be able to resize the columns.
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"