Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# class library to use with Excel VBA Pin
Peter_in_278029-Sep-16 18:20
professionalPeter_in_278029-Sep-16 18:20 
GeneralRe: C# class library to use with Excel VBA Pin
BobbyStrain30-Sep-16 9:54
BobbyStrain30-Sep-16 9:54 
QuestionAI in c# Pin
Member 861393428-Sep-16 8:32
Member 861393428-Sep-16 8:32 
AnswerRe: AI in c# Pin
Dave Kreskowiak28-Sep-16 8:55
mveDave Kreskowiak28-Sep-16 8:55 
AnswerRe: AI in c# Pin
Pete O'Hanlon28-Sep-16 11:31
mvePete O'Hanlon28-Sep-16 11:31 
AnswerRe: AI in c# Pin
Gerry Schmitz28-Sep-16 13:20
mveGerry Schmitz28-Sep-16 13:20 
AnswerRe: AI in c# Pin
Abhinav S2-Oct-16 16:56
Abhinav S2-Oct-16 16:56 
QuestionHelp with "Invoke or BeginInvoke cannot be called on a control until the window handle has been created." Pin
turbosupramk328-Sep-16 6:28
turbosupramk328-Sep-16 6:28 
Hi. What I'm trying to accomplish is to call this class, pass some controls and values and then have the new object update the existing control.

Help with this would be appreciated? Maybe it is not possible since I cannot pass the handle value to the class?

The error is a little misleading as the control is already created?


C#
private void btnGroupsForUserTest_Click(object sender, EventArgs e)
  {

      progressBarControl pbarcontrol = new progressBarControl();
      pbarcontrol.pbarIncrementValue = 1;
      pbarcontrol.pbarMaximum = 100;
      pbarcontrol.pbarThreadSleepIncrement = 250;
      pbarcontrol.pbarObject = pBarGroupsForUser;
      pbarcontrol.pbarLabel = lblGroupsForUserStatus;

      progressBarIncrementer = new Thread(new ThreadStart(pbarcontrol.pbarIncrementFunction));
      progressBarIncrementer.IsBackground = true;
      progressBarIncrementer.Start();
      }



C#
public class progressBarControl : FormGroupMemberShipCheckingTool
{
    public ProgressBar pbarObject;// { get; set; }
    public Label pbarLabel;// { get; set; }


    public int pbarMaximum { get; set; }
    public int pbarIncrementValue { get; set; }
    public int pbarThreadSleepIncrement { get; set; }

    public void pbarIncrementFunction()
    {

        int incrementValue = pbarIncrementValue;
        do
        {
            this.Invoke((MethodInvoker)delegate()
            {
                if (incrementValue < pbarMaximum)
                {
                    pbarObject.Value = incrementValue;
                    pbarLabel.Text = incrementValue.ToString() + "% complete";
                    Application.DoEvents();
                }
            });
            incrementValue++;
            Thread.Sleep(pbarThreadSleepIncrement);
        } while (incrementValue < pbarMaximum);
    }

}

AnswerRe: Help with "Invoke or BeginInvoke cannot be called on a control until the window handle has been created." Pin
Richard Deeming28-Sep-16 7:23
mveRichard Deeming28-Sep-16 7:23 
GeneralRe: Help with "Invoke or BeginInvoke cannot be called on a control until the window handle has been created." Pin
turbosupramk328-Sep-16 7:27
turbosupramk328-Sep-16 7:27 
QuestionCreate PDF from iTextSharp in Unity3d for iOS Pin
Radiance Cosmedic Centre28-Sep-16 0:41
Radiance Cosmedic Centre28-Sep-16 0:41 
AnswerRe: Create PDF from iTextSharp in Unity3d for iOS Pin
Richard MacCutchan28-Sep-16 2:36
mveRichard MacCutchan28-Sep-16 2:36 
QuestionDateTime ISO 8601 Format Pin
tadhg8827-Sep-16 23:52
tadhg8827-Sep-16 23:52 
AnswerRe: DateTime ISO 8601 Format PinPopular
Daniel Pfeffer28-Sep-16 0:00
professionalDaniel Pfeffer28-Sep-16 0:00 
GeneralRe: DateTime ISO 8601 Format Pin
OriginalGriff28-Sep-16 0:25
mveOriginalGriff28-Sep-16 0:25 
GeneralRe: DateTime ISO 8601 Format Pin
Ravi Bhavnani28-Sep-16 3:45
professionalRavi Bhavnani28-Sep-16 3:45 
GeneralRe: DateTime ISO 8601 Format Pin
tadhg8828-Sep-16 23:30
tadhg8828-Sep-16 23:30 
GeneralRe: DateTime ISO 8601 Format Pin
Daniel Pfeffer29-Sep-16 0:54
professionalDaniel Pfeffer29-Sep-16 0:54 
QuestionDatamodel for Survey Form Pin
Member 1204569227-Sep-16 22:57
Member 1204569227-Sep-16 22:57 
AnswerRe: Datamodel for Survey Form Pin
Gerry Schmitz28-Sep-16 8:09
mveGerry Schmitz28-Sep-16 8:09 
GeneralRe: Datamodel for Survey Form Pin
Member 1204569228-Sep-16 21:15
Member 1204569228-Sep-16 21:15 
QuestionColumn sum of multiple columns of dynamic gridview using Javascript Pin
SREENATH GANGA27-Sep-16 21:57
SREENATH GANGA27-Sep-16 21:57 
AnswerRe: Column sum of multiple columns of dynamic gridview using Javascript Pin
Pete O'Hanlon27-Sep-16 23:20
mvePete O'Hanlon27-Sep-16 23:20 
QuestionDelegates with Events Pin
Member 1116162526-Sep-16 18:01
Member 1116162526-Sep-16 18:01 
AnswerRe: Delegates with Events Pin
Pete O'Hanlon26-Sep-16 19:36
mvePete O'Hanlon26-Sep-16 19:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.