Solved

Adding a row in the listview from another form.

Posted on 2012-04-09
1
273 Views
Last Modified: 2012-06-21
Hi,

I am using C# and i programm in VS2010.

I have a mainform with a listview called lvNotes on it, and a second form called stickynotes.

After closing the stickynotes form I want to create a row in the listview on the mainform.
This is what I have:

        private void StickyNotes_FormClosed(object sender, FormClosedEventArgs e)
         {
                ListViewItem myItem = new ListViewItem(lblTitle.Text, 0);
                myItem = lvNotes.Items.Add(myItem); <=====================
                myItem.SubItems.Add(rtbContent.Text);
                myItem.SubItems.Add(lblCreation.Text);
                myItem.Selected = true;
            }

Open in new window


But I don't know how to create a row in the listview from the StickyNotes form!

I get error:

The name 'lvNotes' does not exist in the current context

Who can help me?

Peter Kiers
0
Comment
Question by:peterkiers
1 Comment
 
LVL 17

Accepted Solution

by:
Anuroopsundd earned 500 total points
ID: 37822653
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 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