Click here to Skip to main content
15,910,872 members
Home / Discussions / C#
   

C#

 
AnswerRe: Need Help | Increase .NET knowledge Pin
Member 1276600929-Sep-16 19:50
Member 1276600929-Sep-16 19:50 
GeneralRe: Need Help | Increase .NET knowledge Pin
Pete O'Hanlon29-Sep-16 21:38
mvePete O'Hanlon29-Sep-16 21:38 
AnswerRe: Need Help | Increase .NET knowledge Pin
Nathan Minier30-Sep-16 1:16
professionalNathan Minier30-Sep-16 1:16 
PraiseRe: Need Help | Increase .NET knowledge Pin
Member 117967153-Oct-16 5:32
Member 117967153-Oct-16 5:32 
QuestionText speed control using text to speech winform c# application. Pin
Member 1229735329-Sep-16 2:20
Member 1229735329-Sep-16 2:20 
AnswerRe: Text speed control using text to speech winform c# application. Pin
Pete O'Hanlon29-Sep-16 2:45
mvePete O'Hanlon29-Sep-16 2:45 
GeneralRe: Text speed control using text to speech winform c# application. Pin
Member 1229735329-Sep-16 7:00
Member 1229735329-Sep-16 7:00 
GeneralRe: Text speed control using text to speech winform c# application. Pin
Pete O'Hanlon29-Sep-16 7:15
mvePete O'Hanlon29-Sep-16 7:15 
AnswerRe: Text speed control using text to speech winform c# application. Pin
Dave Kreskowiak29-Sep-16 2:49
mveDave Kreskowiak29-Sep-16 2:49 
QuestionCan I Convert list = new List<...> from Net 4.0 to Net 2.0 ? Pin
Member 245846728-Sep-16 15:25
Member 245846728-Sep-16 15:25 
AnswerRe: Can I Convert list = new List<...> from Net 4.0 to Net 2.0 ? Pin
Pete O'Hanlon28-Sep-16 21:30
mvePete O'Hanlon28-Sep-16 21:30 
AnswerRe: Can I Convert list = new List<...> from Net 4.0 to Net 2.0 ? Pin
OriginalGriff28-Sep-16 21:44
mveOriginalGriff28-Sep-16 21:44 
AnswerRe: Can I Convert list = new List<...> from Net 4.0 to Net 2.0 ? Pin
Member 245846729-Sep-16 17:50
Member 245846729-Sep-16 17:50 
QuestionC# class library to use with Excel VBA Pin
BobbyStrain28-Sep-16 14:33
BobbyStrain28-Sep-16 14:33 
AnswerRe: C# class library to use with Excel VBA Pin
Peter_in_278028-Sep-16 16:15
professionalPeter_in_278028-Sep-16 16:15 
GeneralRe: C# class library to use with Excel VBA Pin
BobbyStrain29-Sep-16 17:44
BobbyStrain29-Sep-16 17:44 
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 

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.