Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
VB.NET
Windows Forms
Double Click Listview selected item and show in picturebox
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Dwhite, post: 186071, member: 70019"] Evening all, Hope all are well. As the title says im having difficulty with selecting listview item and displaying in a picturebox. Basically i want to doubleclick an image in a listview and the item will show in a picturebox. If you are able to provide assistance please let me know. i keep receiving "System.ArgumentException: 'Parameter is not valid.'" I have added my codes below. [CODE=vbnet] Private Sub ListView1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.DoubleClick Dim list As New List(Of Bitmap) Dim gameObject As New Dictionary(Of Integer, Bitmap) ListView1.Items.Add(0) ListView1.Items.Add(1) ListView1.Items.Add(2) gameObject.Add(1, New Bitmap("Picture1.jpg")) gameObject.Add(2, New Bitmap("Picture2.jpg")) gameObject.Add(3, New Bitmap("Picture3.jpg")) Dim i As Integer i = CInt(ListView1.SelectedItems(0).Text.ToString) PictureBox1.Image = gameObject(i) End Sub[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
VB.NET
Windows Forms
Double Click Listview selected item and show in picturebox
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom