"PauloFor" <pa******@uol.com.br> wrote in message
news:eV**************@TK2MSFTNGP15.phx.gbl...
In this code :
public abstract class DCMenuAgrupado
{
Object x = this;
}
Why I can t use keyword 'this' ?
compile error : Keyword this is not available in the current context
The this keyword is a reference (pointer) to the current object. The lone
executable statement you cite in your class definition is not within a
method, which is probably causing the problem. Another potential sticking
point is that your class is abstract, and thus, cannot be instantiated. How
can there be a current object?
See what happens if you try something like this (no pun intended):
public class MyClass
{
public void myMethod()
{
// put you code here
}
}
--
Peter [MVP Visual Developer]
Jack of all trades, master of none.