473,569 Members | 2,731 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_ItemD rag(ByVal sender As Object, ByVal e As System.Windows. Forms.ItemDragE ventArgs) Handles lvProdImg.ItemD rag
DoDragDrop(e.It em, DragDropEffects .Move)
End Sub

Private Sub lvProdImg_DragE nter(ByVal sender As Object, ByVal e As System.Windows. Forms.DragEvent Args) Handles lvProdImg.DragE nter
e.Effect = DragDropEffects .Move
End Sub

Private Sub lvProdImg_DragD rop(ByVal sender As Object, ByVal e As System.Windows. Forms.DragEvent Args) Handles lvProdImg.DragD rop
Dim lvitem, srcitem As ListViewItem
Dim destlv As ListView = CType(sender, System.Windows. Forms.ListView)

Dim clX, clY As Integer
If e.Data.GetDataP resent("System. Windows.Forms.L istViewItem", False) Then

srcitem = CType(e.Data.Ge tData("System.W indows.Forms.Li stViewItem"), ListViewItem)
clX = destlv.PointToC lient(New Point(e.X, e.Y)).X
clY = destlv.PointToC lient(New Point(e.X, e.Y)).Y

lvitem = destlv.GetItemA t(clX, clY)
If Not lvitem Is Nothing Then
destlv.Items.In sert(lvitem.Ind ex, srcitem.Clone)
srcitem.Remove( )
End If
End If

End Sub
Jul 21 '05 #1
0 2507

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

Similar topics

2
8616
by: Kanaiya | last post by:
hello how to put images in either listbox or listview.bye. -- With regards, Gangani Kanaiya.
3
9093
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 TextBox has focus, but I still want the corresponding row in the ListView to be higlighted. Is this possible? Hope to hear from someone out there....
0
1279
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 anyone help? Thanks,
1
1214
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 background, but I don't see anything that should be hiding the contents. I've inserted various msgbox lines to display listview1.Items.Count, and these show...
0
997
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 from this listview to the second listview various ways. What I need help with is I would like to keep the items in the first listview in the same...
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 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...
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 answer but anyways here is my code any help would be greatly apperciated. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As...
0
1135
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 next time the app starts using a few if statements to reset the state. Ewww. This is ugly.
4
14464
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 to the ImageList When i want to see the item "icon" with the imagelist imageindex
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.