473,503 Members | 2,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2497

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

Similar topics

2
8607
by: Kanaiya | last post by:
hello how to put images in either listbox or listview.bye. -- With regards, Gangani Kanaiya.
3
9087
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
1275
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
1212
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
989
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
266
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
472
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
1126
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
14458
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
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7349
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
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5594
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,...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.