Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

vb.net - remove item from listview

Posted on 2009-12-16
3
Medium Priority
?
308 Views
Last Modified: 2012-05-08
hello there,
I would like to have a button that can set the text from a textbox as the first item of the listview and then clear that specific item from the listview.. how can I do that?
0
Comment
Question by:XK8ER
3 Comments
 
LVL 9

Expert Comment

by:Trideep Patel
ID: 26068919
For adding textbox item at first position
use this

 Dim ivItem As New ListViewItem(TextBox1.Text)
 ListView1.Items.Insert(0, ivItem)
0
 
LVL 1

Author Comment

by:XK8ER
ID: 26068923
I mean I would like for textbox1.text = first item from listview
then clear first item of listview
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 200 total points
ID: 26068930
That would be:

        If ListView1.Items.Count > 0 Then
            TextBox1.Text = ListView1.Items(0).Text
            ListView1.Items.RemoveAt(0)
        End If
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Screencast - Getting to Know the Pipeline
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question