473,769 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inconsistent accessiblity compiler error when putting public metho

I am trying to extend TreeView to add some of my own functionality and I
needed to put a public method but the compiler won't let me and I really
don't understand why.

I declared my class:

public class MyTree : TreeView

and then tried to add a simple method:

public void DoSomething() { }

and compiler will not let me... my method name does not conflict with
anything existing in TreeView...
Oct 26 '06 #1
2 1465

MrNobody wrote:
I am trying to extend TreeView to add some of my own functionality and I
needed to put a public method but the compiler won't let me and I really
don't understand why.

I declared my class:

public class MyTree : TreeView

and then tried to add a simple method:

public void DoSomething() { }

and compiler will not let me... my method name does not conflict with
anything existing in TreeView...
"...compile r will not let me..."

Can you post a short, complete program (one that compiles) that
demonstrates this compiler error? It should be very easy if it's
nothing more than inheriting from TreeView and adding one method.

Can you also please post the exact text of the compiler error message
you're getting?

Oct 26 '06 #2
Has the method in question really returnin void and doesn't have any
parameters.
Form the text of the message i what guess the method is using a type as
return or parameter type that is not public. Then the method itself also
can't be public. Other users wouldn't be able to use this method.

Otherwise. look at the answer of Bruce Wood.

"MrNobody" <Mr******@discu ssions.microsof t.comschrieb im Newsbeitrag
news:FB******** *************** ***********@mic rosoft.com...
>I am trying to extend TreeView to add some of my own functionality and I
needed to put a public method but the compiler won't let me and I really
don't understand why.

I declared my class:

public class MyTree : TreeView

and then tried to add a simple method:

public void DoSomething() { }

and compiler will not let me... my method name does not conflict with
anything existing in TreeView...

Oct 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5750
by: Matt | last post by:
I'm new to Java but experienced with PL/SQL. I've found what appears to be strange behaviour (a bug?) when attempting to create java stored objects using the UNIX version of Oracle SQL*PLUS 8.1.7.3.0 with JServer 8.1.7.3.0. The reason it seams strange is that the problem only occurs with the UNIX version of SQL*PLUS, not the PC client version running on Windows 2000 but connected to the same database and schema. Can anyone shed any light...
4
5422
by: james margey | last post by:
Hi to all, I have spent 3 days at this error and i have two days to go for a deadline, and i am about to go off my nut, the reason being: Microsoft dont seem to be able to provide a solution, I have trawled the web and the few that have the same error have not being provided a fix. This error occurs if i make the slightest change in my project. If i REBUILD my project no error occurs. So i keep having to rebuild my project - this is not...
3
1939
by: John C Kirk | last post by:
I've come across an odd situation, where doing a floating point division produces different results for the same numbers. Basically, there are 4 ways to run this application: A) Debug build, inside the IDE B) Debug build, outside the IDE (e.g. launched from Explorer) C) Release build, inside the IDE D) Release build, outside the IDE Using methods A-C produces one result, and using method D produces a
3
37081
by: AAV | last post by:
what is wrong with the code i get 'Error 1 Inconsistent accessibility: parameter type 'ConsoleApplication1.Garage.CarDelegate' is less accessible than method 'ConsoleApplication1.Car.process(ConsoleApplication1.Garage.CarDelegate) ' E:\VS2005_Study\Delegates.cs 49 23 ConsoleApplication1 ' using System;
20
2623
by: Francine.Neary | last post by:
I am learning C, having fun with strings & pointers at the moment! The following program is my solution to an exercise to take an input, strip the first word, and output the rest. It works fine when you give it 2 or more words, but when there's only 1 word the results vary depending on whether it's on Windows or Linux: under MSVC it displays no output (as it should); under gcc/Linux it instead gives "Segmentation fault". Any ideas...
1
3232
by: bachyen | last post by:
I have the following code, but it is error when I build it. Can you help me? Can you tell me more about 'Inconsistent accessibility: return type', 'Inconsistent accessibility: parameter type'. using System; public class Tinh_khoang_cach_Ham_tu_dinh_nghia { struct DIEM { public Double x;
12
7557
by: ibloom | last post by:
I've been trying for a couple days to build a program using pyObjC on a mac, I'm stuck on this error: <string>: inconsistent use of tabs and spaces in indentation Traceback (most recent call last): File "setup.py", line 59, in ? setup(**setup_options) File "/Library/Frameworks/Python.framework/Versions/2.4//lib/ python2.4/distutils/core.py", line 149, in setup dist.run_commands()
9
5172
by: dylan.miller | last post by:
I'm having trouble understanding the internal access modifier. There are many classes in my assembly that should not be accessible outside of the assembly. I've used the internal access modifier for these classes. I have public classes that use the internal classes, but I get a CS0051 error if I use an internal class as a parameter to a protected function of a public class. For example: internal class InternalClass { }
1
2291
by: RLN | last post by:
RE: Access 2003 Current setup is: Front end .mdb (Interface, queries, macros, etc) /Back end .mdb (Database Tables) I'm trying to write some code that will prevent users from getting into the code (ie. right clicking for form design mode, F11 for the container, etc.) I'm testing this with two buttons on a form in a very simple app containing one table with 3 columns, 2 rows of data and one form based
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10047
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.