Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Inconsistent accessibility: field type 'myListView' is less accessible than field 'mainForm.myListView2'

Posted on 2008-11-10
7
Medium Priority
?
5,745 Views
Last Modified: 2012-05-05
I have a main form where I have built a listview (public) using the VS IDE (MS VS C# Express 2008).  I have a class that is trying to reference that listview, but I'm gettting the above error.

What exactly does this mean, and how do I fix it?
0
Comment
Question by:rmmarsh
  • 4
  • 2
7 Comments
 
LVL 2

Expert Comment

by:ssflynn
ID: 22927169
This means that one class is declared as "Public" and another class has been declared as "Private" or "Internal"
0
 
LVL 18

Expert Comment

by:philipjonathan
ID: 22927208
Declare myListView as public
0
 

Author Comment

by:rmmarsh
ID: 22930248
MyListView is public... 
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:rmmarsh
ID: 22930339
The listview is in the main form which is also public... I have attached code snippets...
                //  now, present the data...
                mainForm mf = new mainForm(false);  //  don't show the splash screen or do any other initialization
                int i = 0;
                foreach (object obj in alData)
                {
                    ListViewItem lvi = new ListViewItem(alData[i].ASIN);
                        lvi.SubItems.Add(alData[i].Title);
                    lvi.SubItems.Add(alData[i].Author);
                    lvi.SubItems.Add(alData[i].Publisher);
 
                    mf.myListView2.Tag = "Title";
                    mf.myListView2.Items.Add(lvi);  // Add the list items to the ListView
                }

Open in new window

0
 
LVL 2

Expert Comment

by:ssflynn
ID: 22930432
What is the declaration for mf.myListView2?  

Is myListView2 a public property?
0
 

Author Comment

by:rmmarsh
ID: 22930457
myListView2 is public... (        public myListView myListView2;)  <- taken from mainform.designer.cs

0
 

Accepted Solution

by:
rmmarsh earned 0 total points
ID: 22933395
I have figured it out myself:  if I pass the listview to the class method, I can get around the addressability propblems.
Thanks everyone for your help...
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

810 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