473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Is it a bug? Listview's largeicon(so is smallicon) does not follow the order of list or detail view

Once you reorder the listview items, largeicon or smallicon view will not follow the order of list or detail view which is the correct order. For example with a listview as
lvProdImg.items(0).text="img0"
lvProdImg.items(1).text="img1"
lvProdImg.items(2).text="img2"
lvProdImg.items(3).text="img3"

once it is reordered as
lvProdImg.items(0).text="img2"
lvProdImg.items(1).text="img0"
lvProdImg.items(2).text="img1"
lvProdImg.items(3).text="img3"

the largeicon and smallicon view will be out of order while list and detail view is correct. Here is how i reorder items through drag and drop

Private Sub lvProdImg_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles lvProdImg.ItemDrag
DoDragDrop(e.Item, DragDropEffects.Move)
End Sub

Private Sub lvProdImg_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lvProdImg.DragEnter
e.Effect = DragDropEffects.Move
End Sub

Private Sub lvProdImg_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lvProdImg.DragDrop
Dim lvitem, srcitem As ListViewItem
Dim destlv As ListView = CType(sender, System.Windows.Forms.ListView)

Dim clX, clY As Integer
If e.Data.GetDataPresent("System.Windows.Forms.ListVi ewItem", False) Then

srcitem = CType(e.Data.GetData("System.Windows.Forms.ListVie wItem"), ListViewItem)
clX = destlv.PointToClient(New Point(e.X, e.Y)).X
clY = destlv.PointToClient(New Point(e.X, e.Y)).Y

lvitem = destlv.GetItemAt(clX, clY)
If Not lvitem Is Nothing Then
destlv.Items.Insert(lvitem.Index, srcitem.Clone)
srcitem.Remove()
End If
End If

End Sub
Jul 21 '05 #1
0 2491

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kanaiya | last post by:
hello how to put images in either listbox or listview.bye. -- With regards, Gangani Kanaiya.
3
by: Rookie | last post by:
Hi, Is there any way I can keep an item in a ListView higlighted even when the ListView does not have focus. eg. If the user is modifying the row by entering values in a TextBox then the...
0
by: Al Findlay | last post by:
Hello! I have a listview which has a column of images. The problem is, I want to be able to align the images to the centre of the column. By default, the images always align to the left. Can...
1
by: rallard | last post by:
After the following subroutine executes, my listview shows a scroll bar on the right, but it is otherwise blank. I've checked for things like locked=false, visable=true, font color same as...
0
by: thomasp | last post by:
I have a 2 listviews on a windows form in my VB2005 applicaion. The first listview is populated by the columns from a database table when the form opens. The user can move items back and forth...
0
by: Hunters | last post by:
Once you reorder the listview items, largeicon or smallicon view will not follow the order of list or detail view which is the correct order. For example with a listview as...
3
by: Curtis | last post by:
I am trying to do a simple sort on a list view.With the listview control the first time I sort on the control it sorts the items but anytime after that it fails to sort. I'm sure this is a simple...
0
by: Jon Berry | last post by:
I would like to save the View state of a ListView. The only thing I have come up to get the current state is ListView1.View.ToString(); Then I save the string to a file and load it back in the...
4
by: Archimed | last post by:
Hi, I try to use an ImageList with a ListView but that don't work. I make a ListView in VirtualMode with LargeIcon view. I put the ImageList in the LargeImageList property. I add a bitmap...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.