Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi Friends

Iam beginner of the C# Language and Programming.so please provide the code in my Quesion ASAP
Language : C#.net.
QUESTION : Iam Using Two text boxes and One Button(ADD),Listview Control.so my Question is Whenever I enter some data in text boxes and Click Add button then Automatically that dat astored in Listview HOW???.........


Thanks In Advance
Sheshu
Posted
Comments
kayalasheshu 24-Jan-13 6:37am    
hi all please send me code in clearly .............

You may use the following code as a method.
pass your list view control and the text from textbox1 and textbox1 as separate function callings.

C#
private void AddItemtoListViewControl(ListView lst,string sText)
        {
            string sItem = sText;
            lst.Items.Add(sItem);
        }
 
Share this answer
 
C#
private void button1_Click(object sender, EventArgs e)
{
     listBox1.Items.Add(textBox1.Text.Trim() + textBox2.Text.Trim());
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900