Progressbar strange error

solved
[12 byte] By [BrianGordon] at [2007-12-16]
# 1

The problem is that getpostcount is static. That is, it is a shared method between all instances of the Form1 class. So when it is called it needs to know which instance of Form1 (as there can be more than 1) it needs access.

You can fix this a couple of ways:

1. Simply remove the static keyword from the getpostcount method

-or-se

2. Pass an instance of Form1 to the method:

public static string getpostcount(Form1 form, string uid)
{
...
form.progressBar1.PerformStep();
}

Also be aware that C# is case-sensitive, so members (ie properties and methods) must be correctly cased, so progressBar1.performStep() should be progressBar1.PerformStep() and progressBar1.value should be progressBar1.Value.

DavidM.Kean at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...