When answering a question please: • Read the question carefully. • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Nov 28, 2005 Hi, I have a listview with 3 columns, and some rows. I have searched the internet for a code to edit a value of a subitem. I found soms code, like: ListView1.ListItems(2).SubItems(3) = 'something', but this won't work. I have a ListView control on my form set up like. Getting data from a ListView into an array. Browse other questions tagged vb.net listview arrays or ask your. Visual Basic Classic Populate Listview from an array. Real simple question. = 'Subitem ' & i Next j Next i End Sub Try get the ideas from above. Insults are not welcome. • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid. No, not using the control as provided. Only the main column provides in-place editing. You can, however, duplicate this functionality using another text box you position over the subitems on clicking. Give this a try --- toss all this into a form's genearal declarations section after you've added only a listview and textbox (both with the default names). Thanks Randy Greets John 'Randy Birch' schreef in bericht news:u_*******************@news01.bloor.is.net.cab le.rogers.com. No, not using the control as provided. Only the main column provides in-place editing. You can, however, duplicate this functionality using another text box you position over the subitems on clicking. Give this a try --- toss all this into a form's genearal declarations section after you've added only a listview and textbox (both with the default names). Ok, so I have a listview on one form, and when a button is pressed it opens up a new form with the contents of the selected listview item and it's subitems in a series of textboxes. The user can then change the data in the textboxes and either press save to make the changes or cancel to close the window. What command would I use to change the selected listview item and subitems to whatever is in the boxes? Robin, Are you using VB6 and the Listview control from that? If memory serves me correctly, the listitems and subitems are 0 based collections. So if you have 3 columns, they should be indexed 0-2. VB6: Debug.Print ListView1.ListItems(0).SubItem(0).Text Debug.Print ListView1.ListItems(0).SubItem(2).Text If you are using Visual Basic 2005, then you need to change your code since the new control has an Items collection, not a ListItems collection.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2018
Categories |