1 Replies - 14997 Views - Last Post: 05 July 2011 - 07:55 AM

#1 complete   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 109
  • Joined: 12-April 07

How do I do this?

Posted 04 July 2011 - 02:58 AM

How do I do this access functionality with a private member?

First of all, I got a runtime error when trying to use the Busy Window Indicator when a seperate thread called the window code associated with the BusyIndicator.

Anyway, so my solution was to try to make this call as public as possible. But now I am getting a compile error. Can someone help me with this?

Please suggest how I can get past this error message.

Posted Image

Is This A Good Question/Topic? 0
  • +

Replies To: How do I do this?

#2 eclipsed4utoo   User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1533
  • View blog
  • Posts: 5,972
  • Joined: 21-March 08

Re: How do I do this?

Posted 05 July 2011 - 07:55 AM

First, what's wrong...

You are trying to use a non-static field (BusyWindow) in a static method (setbusywindow). Static methods can only access static variables/properties/other static methods.

The correct way of doing it...

Your BusyWindow object is already public. There is no need to have a mutator method. .Net doesn't normally use these because of it's use of properties.

To assign a value to the BusyWindow object, you would simply do this..

SomeClass.BusyWindow = new BusyWindow();

Now, if this isn't working as you would expect it to, then you should post that code and we can help you with getting it to work. Also, an explanation of what you are trying to accomplish would also help.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1