On Fri, 18 Apr 2008 07:14:01 -0700, Tammy Nejadian
<Ta***********@ discussions.mic rosoft.comwrote :
Hi, I am using Visual Studio C# windows. Every time I want to use some
of the
methods in System.Windows. Form such as Clear(), it gives me error
message and
saying "System.Windows .Forms.TextBox does not contain a definition for
'Clear'". Could someone help me with that.
As always, no...not really. Not without an actual code example of what
fails.
However, are you sure that is the _exact_ text of the error message you're
getting? A common way to have problems where class members in Forms
namespace classes seem to not exist is that the code mistakenly is using a
class from the wrong namespace, such as Controls or in some cases the
WebUI namespace.
If you are absolutely sure that the error message specifically says
"System.Windows .Forms.TextBox" , then I would say either Marc's guess is
correct (you're trying to access the method statically rather than via an
instance), or you are using the wrong syntax (for example, you've left off
the parens on a method call...but actually, that seems less likely because
if I recall correctly you get a different error than "does not contain a
definition" when you do that).
In any case, without showing us the code that fails, there's no way to
tell you why it's wrong.
Pete