shakira
Container Orchestrator
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
300 XP
I am struggling before on how to get value from selected item in a listview.
As you've seen in my Hotel Reservation System (VB.NET Version) I use the following code to get the value from a Listview.
Although it is working fine but the succeding code will generate an error in the IDE of VB.NET.
After searching the internet I found a good solution to this problem. Just change the code above with this code:
As you've seen in my Hotel Reservation System (VB.NET Version) I use the following code to get the value from a Listview.
- Dim
FolioNumber As
String
- For
Each
sItem As
ListViewItem In
lvList.
SelectedItems
- FolioNumber =
sItem.
Text
- Next
Although it is working fine but the succeding code will generate an error in the IDE of VB.NET.
- With
frmCheckIn
- .
State
=
modGlobal.
FormState
.
adStatePopupMode
- .
FolioNumber
=
FolioNumber '< = Variable "FolioNumber" is used before it has been assigned a value. A null reference exception could result at runtime.
- .
ShowDialog
(
)
- Call
FillList(
)
- End
With
After searching the internet I found a good solution to this problem. Just change the code above with this code:
- .
FolioNumber
=
lvList.
SelectedItems
(
0
)
.
Text