|
-
Apr 11th, 2006, 09:02 AM
#1
Thread Starter
Member
ListView control
When I coding the windows application, I can add the values into listview, same as
ListView1.items.Add("test")
but it can not work in PPC application, how can I code it in cf 1.1 ?
-
Apr 11th, 2006, 09:20 AM
#2
Fanatic Member
Re: ListView control
With the ListView in order to add items to it you need to create a listviewitem then you add the listviewitem to the listview
EG:
Dim lvi As New ListViewItem("test")
listview1.items.add(lvi)
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Apr 11th, 2006, 11:19 AM
#3
Thread Starter
Member
Re: ListView control
Thanks...
I know the ListViewItem support array input, why the program only show "go"?
Dim d(3) As String
d(0) = "go"
d(1) = "to"
d(2) = "you"
Dim lvi As New ListViewItem(d)
ListView1.Items.Add(lvi)
-
Apr 12th, 2006, 03:44 AM
#4
Fanatic Member
Re: ListView control
You need to add subitems to the listviewitem
here is an example
l_dr is just a datareader im using
Dim l_lvi As New ListViewItem(l_dr.Item("ID").ToString)
l_lvi.SubItems.Add(l_dr.Item("RouteNo").ToString)
l_lvi.SubItems.Add(l_dr.Item("CompCode").ToString)
l_lvi.SubItems.Add(Date.Parse(l_dr.Item("DateInit")).ToShortDateString)
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
May 2nd, 2006, 07:33 AM
#5
Thread Starter
Member
Re: ListView control
Thanks, It work...
and do you know how to control the listview items.
such as when I press the listview item, I call the event..
-
May 2nd, 2006, 08:08 AM
#6
Fanatic Member
Re: ListView control
you will do that in the listview click event or else even the itemactivate event
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
May 4th, 2006, 11:20 PM
#7
Thread Starter
Member
Re: ListView control
 Originally Posted by Strider
you will do that in the listview click event or else even the itemactivate event
Thanks,
but when I use Itemactivate event, how can I call I selected item value?
Private Sub ListView1_ItemActivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.ItemActivate
MsgBox(ListView1.Text)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|