5 Replies - 5882 Views - Last Post: 16 November 2009 - 06:59 AM Rate Topic: -----

#1 gbtony   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 14-November 09

backgroundworker progressbar

Post icon  Posted 14 November 2009 - 11:22 PM

public void ProgressBarUpdate()
		{
			MessageBox.Show("in update progress bar", Convert.ToString(progressBarValue));  //debug line to verify correct value present
			this.progressBar1.Value = progressBarValue;
			
		}


Error 1 'new_bgw.Form1.progressBar1' is inaccessible due to its protection level C:\Users\pc\Documents\Visual Studio 2008\Projects\new_bgw\UpdateProgressBar.cs 28 18 new_bgw

need to make progressBar1 visible in outside class

This post has been edited by JackOfAllTrades: 15 November 2009 - 07:06 AM


Is This A Good Question/Topic? 0
  • +

Replies To: backgroundworker progressbar

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: backgroundworker progressbar

Posted 15 November 2009 - 07:06 AM

Make the variable public?
Was This Post Helpful? 0
  • +
  • -

#3 gbtony   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 14-November 09

Re: backgroundworker progressbar

Posted 15 November 2009 - 10:17 AM

View PostJackOfAllTrades, on 15 Nov, 2009 - 06:06 AM, said:

Make the variable public?

wow. thanks for the worthless reply. that's the first thing i tried.
I am using background worker in a class. when using threads i believe i need to use a delegate and invoke method to update progressbar.
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: backgroundworker progressbar

Posted 15 November 2009 - 11:33 AM

Nice attitude.

You dump five lines of code and an error message, what you want and you expect what? I gave you the answer for making something currently inaccessible to an outside class accessible to that outside class, given what little information was provided.
Was This Post Helpful? 0
  • +
  • -

#5 eclipsed4utoo   User is offline

  • Not Your Ordinary Programmer
  • member icon

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

Re: backgroundworker progressbar

Posted 15 November 2009 - 04:59 PM

Did you drag the progressbar onto the form? Or did you create the instance yourself?

Oh, and an attitude like that will get you no help. We don't get paid to be here so you should be grateful of any answer you get.

How about post the code where the progressbar is instantiated.
Was This Post Helpful? 0
  • +
  • -

#6 kstr   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 60
  • Joined: 19-October 09

Re: backgroundworker progressbar

Posted 16 November 2009 - 06:59 AM

You can't access your form/controls from another thread...

look at these:

http://stackoverflow...her-thread-in-c
http://stackoverflow...-forms-controls
http://www.osix.net/...article/?id=832



View Postgbtony, on 15 Nov, 2009 - 09:17 AM, said:

wow. thanks for the worthless reply. that's the first thing i tried.
I am using background worker in a class. when using threads i believe i need to use a delegate and invoke method to update progressbar.



If you have all the answers, why ask here?

furthermore, if you can't be bothered to explain what you have already tried, don't bother to reply like that.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1