Click here to Skip to main content
15,919,434 members
Home / Discussions / C#
   

C#

 
AnswerRe: How get html source code of WebPage? Pin
Luc Pattyn19-Feb-09 11:31
sitebuilderLuc Pattyn19-Feb-09 11:31 
GeneralRe: How get html source code of WebPage? Pin
aleXXXka19-Feb-09 12:44
aleXXXka19-Feb-09 12:44 
GeneralRe: How get html source code of WebPage? Pin
vaghelabhavesh19-Feb-09 13:07
vaghelabhavesh19-Feb-09 13:07 
GeneralRe: How get html source code of WebPage? Pin
aleXXXka22-Feb-09 7:50
aleXXXka22-Feb-09 7:50 
Questionupdating a label from a thread in a different class Pin
liamderice19-Feb-09 10:59
liamderice19-Feb-09 10:59 
AnswerRe: updating a label from a thread in a different class Pin
DaveyM6919-Feb-09 11:12
professionalDaveyM6919-Feb-09 11:12 
GeneralRe: updating a label from a thread in a different class Pin
liamderice20-Feb-09 4:48
liamderice20-Feb-09 4:48 
GeneralRe: updating a label from a thread in a different class Pin
DaveyM6920-Feb-09 6:02
professionalDaveyM6920-Feb-09 6:02 
OK - here's a working sample...
using System;
using System.Threading;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Shown += new EventHandler(Form1_Shown);
        }

        void Form1_Shown(object sender, EventArgs e)
        {
            Thread CopyThread = new Thread(new ThreadStart(DoStuff));
            CopyThread.Start();
        }

        void UpdateLabel(string text)
        {
            label1.Text=text;
        }

        void DoStuff()
        {
            BeginInvoke(new MethodInvoker(
                delegate() { UpdateLabel("I'm doing it..."); })
                );
            Thread.Sleep(5000);
            BeginInvoke(new MethodInvoker(
                delegate() { UpdateLabel("Done!"); })
                );
        }
    }
}


Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

GeneralRe: updating a label from a thread in a different class Pin
liamderice20-Feb-09 9:50
liamderice20-Feb-09 9:50 
GeneralRe: updating a label from a thread in a different class Pin
DaveyM6920-Feb-09 10:06
professionalDaveyM6920-Feb-09 10:06 
GeneralRe: updating a label from a thread in a different class Pin
DaveyM6920-Feb-09 10:27
professionalDaveyM6920-Feb-09 10:27 
AnswerRe: updating a label from a thread in a different class Pin
yuxuanji19-Feb-09 15:01
yuxuanji19-Feb-09 15:01 
AnswerRe: updating a label from a thread in a different class Pin
Luc Pattyn19-Feb-09 15:54
sitebuilderLuc Pattyn19-Feb-09 15:54 
QuestionGeneric Control WinForms and Toolbox/Designer Pin
DaveyM6919-Feb-09 10:54
professionalDaveyM6919-Feb-09 10:54 
AnswerRe: Generic Control WinForms and Toolbox/Designer Pin
Luc Pattyn19-Feb-09 11:34
sitebuilderLuc Pattyn19-Feb-09 11:34 
GeneralRe: Generic Control WinForms and Toolbox/Designer Pin
DaveyM6919-Feb-09 11:44
professionalDaveyM6919-Feb-09 11:44 
AnswerRe: Generic Control WinForms and Toolbox/Designer Pin
Luc Pattyn19-Feb-09 11:56
sitebuilderLuc Pattyn19-Feb-09 11:56 
QuestionI need help whit my programme Pin
ZRF6919-Feb-09 10:43
ZRF6919-Feb-09 10:43 
AnswerRe: I need help whit my programme Pin
Deresen19-Feb-09 11:36
Deresen19-Feb-09 11:36 
AnswerRe: I need help whit my programme Pin
Mycroft Holmes19-Feb-09 13:49
professionalMycroft Holmes19-Feb-09 13:49 
AnswerRe: I need help whit my programme Pin
DaveyM6919-Feb-09 14:23
professionalDaveyM6919-Feb-09 14:23 
QuestionPlease help me with this simple C question Pin
meixiang619-Feb-09 10:00
meixiang619-Feb-09 10:00 
AnswerRe: Please help me with this simple C question Pin
Luc Pattyn19-Feb-09 10:35
sitebuilderLuc Pattyn19-Feb-09 10:35 
Questionproblem whit WS Pin
E_Gold19-Feb-09 9:59
E_Gold19-Feb-09 9:59 
AnswerRe: problem whit WS Pin
Dave Kreskowiak19-Feb-09 11:50
mveDave Kreskowiak19-Feb-09 11:50 

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.