Click here to Skip to main content
15,920,005 members
Home / Discussions / C#
   

C#

 
QuestionReport problem with procedure Pin
merwa23-Jul-07 21:53
merwa23-Jul-07 21:53 
QuestionForm is not response Pin
tradakad23-Jul-07 21:28
tradakad23-Jul-07 21:28 
AnswerRe: Form is not response Pin
Christian Graus23-Jul-07 22:18
protectorChristian Graus23-Jul-07 22:18 
GeneralRe: Form is not response Pin
tradakad23-Jul-07 23:02
tradakad23-Jul-07 23:02 
GeneralRe: Form is not response Pin
Martin#23-Jul-07 23:20
Martin#23-Jul-07 23:20 
GeneralRe: Form is not response Pin
tradakad24-Jul-07 0:41
tradakad24-Jul-07 0:41 
GeneralRe: Form is not response Pin
Martin#24-Jul-07 0:56
Martin#24-Jul-07 0:56 
GeneralRe: Form is not response Pin
Martin#24-Jul-07 1:13
Martin#24-Jul-07 1:13 
Hello,

I would add a method which sets the Text, and check there if Invoke is required.
private delegate void SetLoadingTextDelegate(string actText, bool append);
 
privat void SetLoadingText(string actText, bool append)
{
    //Is Invoke neccessary?
    if(InvokeRequired)
    {
        //Do the Invokation and end the method. It will be called again in the GUI thread over the delegate!
        Invoke(new SetLoadingTextDelegate(EnableTimer), new object[] {actText, append});
        return;
    }
    if(append)
    {
        this.lblLoadingText.Text += actText;
    }
    else
    {
        this.lblLoadingText.Text = actText;
    }
}
 
void  tmrLoading_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
    if (iterationsCount <= 2)
    {
        if (pointCount <= 10)
        {
            SetLoadingText(".", true);
            pointCount++;
            tmrLoading.Start();
        }
        else
        {
            SetLoadingText("Loading", false);
            iterationsCount++;
            pointCount = 0;
        }
    }
    Application.DoEvents();
}

Hope it helps!

All the best,

Martin

GeneralRe: Form is not response Pin
tradakad24-Jul-07 1:38
tradakad24-Jul-07 1:38 
GeneralRe: Form is not response Pin
Martin#24-Jul-07 1:52
Martin#24-Jul-07 1:52 
GeneralRe: Form is not response Pin
tradakad24-Jul-07 2:08
tradakad24-Jul-07 2:08 
GeneralRe: Form is not response Pin
Martin#24-Jul-07 2:18
Martin#24-Jul-07 2:18 
GeneralRe: Form is not response Pin
tradakad24-Jul-07 2:26
tradakad24-Jul-07 2:26 
GeneralRe: Form is not response Pin
tradakad23-Jul-07 23:58
tradakad23-Jul-07 23:58 
Questiondatagrid update command Pin
srinivassam23-Jul-07 21:01
srinivassam23-Jul-07 21:01 
QuestionException has been thrown by the target of an invocation Pin
Darkness8423-Jul-07 20:23
Darkness8423-Jul-07 20:23 
AnswerRe: Exception has been thrown by the target of an invocation Pin
Darkness8423-Jul-07 20:35
Darkness8423-Jul-07 20:35 
GeneralRe: Exception has been thrown by the target of an invocation Pin
Darkness8423-Jul-07 21:29
Darkness8423-Jul-07 21:29 
GeneralRe: Exception has been thrown by the target of an invocation Pin
Amjath Rahman23-Jul-07 21:33
Amjath Rahman23-Jul-07 21:33 
GeneralRe: Exception has been thrown by the target of an invocation Pin
Amjath Rahman23-Jul-07 21:36
Amjath Rahman23-Jul-07 21:36 
GeneralRe: Exception has been thrown by the target of an invocation Pin
Luc Pattyn24-Jul-07 2:04
sitebuilderLuc Pattyn24-Jul-07 2:04 
QuestionVideo handling Pin
pavya_Cool23-Jul-07 20:10
pavya_Cool23-Jul-07 20:10 
AnswerRe: Video handling Pin
ekynox23-Jul-07 21:35
ekynox23-Jul-07 21:35 
QuestionRe: Video handling Pin
pavya_Cool23-Jul-07 22:22
pavya_Cool23-Jul-07 22:22 
AnswerRe: Video handling Pin
Pete O'Hanlon23-Jul-07 22:42
mvePete O'Hanlon23-Jul-07 22:42 

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.