Passing index number from form1.listview to form2.combobox?

  • Thread starter Thread starter gsb58
  • Start date Start date
G

gsb58

Hi!

On a main form I have a ListView, lstMyView.

The list have values in column1 like:

06:00
06:30

and so on....

When user click's a value, I'll have a second form open. Here user can
choose a value from a combobox that carries the same textvalues as in
the listview on the mainform.

Is it possible to have the combobox on the second form opened and show
the same value that user clicked on the list in the mainform?

Me.Name
 
Are you saying that the cbo lists ALL items in the listview but has the
listview.selecteditem also 'selected' in the cbo? Or do you only want to
show the listview.selecteditem in the cbo?

Rgds, Phil
 
Yes.

The cbo have the same textvalues as the listview. The textvalues are
like:

06:00
06:30
07:00
07:30
and so on....up to 15:30

And I want he cbo have the same item selected and highlighted that is
being clicked in the listview of the mainform.

Why a cbo then on the second form?

Because if the user changes his/her's mind about the time, they should
still be able to click the cbo and choose another time!
 
If you set the datasource property of your cbo to lstvw.items then it will
'automatically' shadow the collection as well as the selected item.

Rgds, Phil
 
Hi!
Thanks for answering.

There is no datasource. This is purely a training case.

I'm passing data directly from Form2 to Form1.

Maybe I could do it even more easier with an Inputbox?

And then have the data written to ListView and selectedIndex as the
user click's OK?

And then I could save the ListView to disk as a .txt-file?

But do you know how I could write to the second column?

Me.Name
 
Back
Top