Can't see textbox control

T

tshad

This makes not sense at all.

I created a textbox on my screen and set the name property to "Status".

If I double click on the textbox, it goes to the code page and shows:

private void Status_TextChanged(object sender, EventArgs e)
{

}

So obviously, it sees the object.

But in my code I have:

Status.Text += String.Format("Opening
{0}\n",Path.GetFileName(strFile));

And I get the following error:

An object reference is required for the nonstatic field, method, or property
'FileProcess.'FileProcess.Status'

How can that be????

In my FileProcess designer page I have:

private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox Status;
private System.Windows.Forms.Label label1;

So obviously the object is there.

Thanks,

Tom
 
T

tshad

I found the problem.

I had function set a static (as it came from another program where it needed
to be static).

When I took the static off, it disappears.

Not sure why that would be a problem.

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top