Solved

Adding a row in the listview from another form.

Posted on 2012-04-09
1
269 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
Comment Utility
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now