I've got this little problem with my listview Control, I decided I wanted to hide some of my data in each listview item so I inherited from the Listview "DiaryItem".The problem is I'm in this cross threading situation and I cannot seem to overwite one Listviewitem object with another, I'm sure its some sort of refrencing problem as when it goes out of scope(function close) the original data is still present, I know I could add the new data by adding a new ListviewItem and deleting the old one but they must be away around this.
Because of cross threading I could not use Items even though I'm checkign for it. Code:
I have a text file that needs to be uploaded to a ftp , however it needs to overwrite any existing file with that name.the filename will never change but data inside does, thats why we need to upload it to provide the most current data.filename = rawdata.txt..I have a basic form with a timer or button to send the file, I just need the code. In the mean time im messing with my last post code to see if there is a way to modify it to upload files but not having much luck.You Know Your Addicted To Computers When - Your main computer is a 7 terabyte, Core2Quad 3 Ghz +, with 4 or more gigs ram, over 200 programs installed, and you would rather sit with it programming than go to the movies!I've got 13 PC's in the House and 7 are in my bedroom and my main one exceeds this set of stats. Does anyone know a good psychologist?
I have a group of objects I set values in and then place in a hashtable with the keys stored in an array. When something happens and I want to replace the original object stored in the hashtable with a newer version I have no idea what to do. For example:
This adds the original object to the hashtable but after some conditional check a new object with the same fields but different values is created and needs to replace the original object. I tried setting the values from the new object to the old object like this:
How can I save an Excel-file, which I'd edit with VB.NE, to a file, which already exists? Evertime there is a dialog: File already exists. Do you really want to overwrite? YES|NO|Abort
Is it somehow possible to use the 'With' keyword on an existing object?I would like to do the following using LINQ to objects and can't seem to find a way:
From m as Product in Me _ Select m With {.Match = m.Name.IndexOf(query)} _ Where m.Name.IndexOf(query) > 0
I have just started to work with Webservices and the vendor have provided me with a wsdl reference file.I have added the file to my project.The examples the vendor provide is written in C# (which I wish I was programming in) but I'm a old school VB programmer so I'm trying to map it over. In the examples they seem to initate a new array in an existing object but I can't figure out how to do this in VB?The example shows the following (C#)
Security_Authenticate sec_auth = new Security_Authenticate(); sec_auth.dutyCode = new Security_AuthenticateDutyCode(); sec_auth.dutyCode.dutyCodeDetails = new Security_AuthenticateDutyCodeDutyCodeDetails();
on cloning a selected listviewitem from listview1 when a button is clicked to listview2. How do I achieve this? Here is the code I have but does not work exactly how I want it, it just makes a clone of all the listviewitems in listview1.
foreach (ListViewItem item in this.listView1.Items) this.listView2.Items.Add((ListViewItem)item.Clone());
I want to start a thread, which handles a class.That class should add a listviewitem into a listview on the main form.[code]No idea why that doesn't work.I really need threading, cause it would block the program.These codes are examples, the real one is with loops & stuff, so that blocks the program.
I am trying to find a way to associate a key with an index for a Listviewitem in VB.Net. I'm not even sure if it can be done with .Net but I know in VB6 I could do a
Listview.listitem.add "somestring", "somestring".
For the application I am using this in, I cannot have duplicate item.text so I would make the key the same as the string. this also made accessing the item easier since I didn't have to rely on index to update the subitems.
I have a ListView, wich its View property is set to LargeIcon and there isn't any ImageList attached to it.The thing is that ListViewItem's text overlaps next ListViewItem's text. With View set to Tile I have no problem at all, but It shows the items one below another.When I add columns header,I set their width to a large number,but it seems that ListViewItem doesn't care,I get the same mentioned effect.My question is wich property do I have to change to avoid ListViewItem's text overlapping?
Here is my problem, I have been learning about SendMessage and getting the Handles of Windows. In the following code example I show that I can get the number of Items in a ListView Control by API, but I have no idea of how to select an Item within the Control, ListView; in other words, how to select a ListViewItem:
I have a form that has a listview with a number of items on it. In certain circumstances, when I load the form, I want a particular item to be automatically selected. The user will select the item to be selected from another form, and I will pass this item to the form in question.
But how do I tell the listview 'hey, set this item as your selected item?" There isn't a writable 'SelectedItem' property.
I have been learning about SendMessage and getting the Handles of Windows. In the following code example I show that I can get the number of Items in a ListView Control by API, but I have no idea of how to select an Item within the Control, ListView; in other words, how to select a ListViewItem:
Public Class Form1 'Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
I have Main and Detail forms. The Main form has ListView1. I would like to select new added ListViewItem in ListView1 when user click Save button in Detail form. I have problem only when I'm adding new item. When I modify and save existing item according item is selected after save command.
below is a small part of my asynchronous TCP connection code. When I connect I'm passing a ListViewItem as Object parameter. I'd like to update the ListViewItem once the connection has been established or an error occurs. ServerConnect runs on a separate thread, because it's an asynchronous connection, so I can't update the ListViewItem directly.
Does anybody know how to update the ListViewItem?
I looked at jmcilhinney's asynchronous TCP example in the Codebank forum, but it confused me. I don't know which parts I need and which parts I don't need.
::edit::
One more thing. I also need to update the ListViewItem in the Read sub, but I'm passing "buffer" as Object, so how would I update the ListViewItem there?
vb.net Imports System.Net.Sockets Public Class TCP Private Socket As TcpClient
I have a listview but I would like to add 3 properties (for example one of them is "image") to the listviewitems in it. I was fine with making a custom class with the 3 properties and just inheriting ListViewItem but now I need to use MultiSelect, so it means doing things like(in For Each loops):
ListView1.SelectedItems.Item(i).Image don't work because it returns a ListViewItem not my CustomClass. I could always do : Ctype(ListView1.selectedItems(i), MyCustomClass).Image
But using that over and over again seems like a waste/wrong way to do it?
I have a listview control on a form. This listview control is populated with at times thousands of listviewitems.Part of my process, is running through custom made filters, to hide unwanted items (before they're even inserted into the listview).So as I hinted earlier, the way I hide items that I don't want is by not inserting them at all. I'd like to make a shortcut available, that would allow me to show / hide the hidden items by simply pressing the shortcut.
My problem is that if I do this, I have to 'refresh' the listview items everytime as I do now ( by removing all and re-inserting the ones I want ).Is there no faster / better way than by removing / re-inserting the items ( which takes roughly 2-3 seconds ); which is a noticeable-enough delay? for a 'visible' property on the listviewitem that I could set to true / false, but that property doesn't appear to exist.As it stands, I have to resort to removing / re-inserting the new 'view' every time.
I have an app with multiple ListViews W/DragnDrop....I want the text that is first in the list to always be BOLDed. My attempt to bold (below) fails saying readOnly...how can I get around this apparently default property?
Private Sub ListView_DragDrop(ByVal sender As Object, ByVal e As _ System.Windows.Forms.DragEventArgs) Handles ListView1.DragDrop, _ ListView2.DragDrop, ListView3.DragDrop, ListView4.DragDrop, ListView5.DragDrop, _ ListView6.DragDrop, ListView7.DragDrop, ListView8.DragDrop, ListView9.DragDrop, _ ListView10.DragDrop, ListView11.DragDrop, ListView12.DragDrop, ListView13.DragDrop, _ [Code] .....
I have multiple listviews. As I click between ListViewItems in listview/s, I want to be able to know which ListViewItem was click so I can then call a procedure.