Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
AnswerRe: call private void btnSave_Click(object sender, EventArgs e) Pin
Luc Pattyn22-Mar-10 14:47
sitebuilderLuc Pattyn22-Mar-10 14:47 
GeneralRe: call private void btnSave_Click(object sender, EventArgs e) Pin
ricmil4223-Mar-10 3:26
ricmil4223-Mar-10 3:26 
AnswerRe: call private void btnSave_Click(object sender, EventArgs e) [modified] Pin
DaveyM6922-Mar-10 12:35
professionalDaveyM6922-Mar-10 12:35 
AnswerRe: call private void btnSave_Click(object sender, EventArgs e) Pin
AspDotNetDev22-Mar-10 13:37
protectorAspDotNetDev22-Mar-10 13:37 
GeneralRe: call private void btnSave_Click(object sender, EventArgs e) Pin
Not Active22-Mar-10 14:09
mentorNot Active22-Mar-10 14:09 
QuestionForm is Flickering Pin
Jassim Rahma22-Mar-10 11:53
Jassim Rahma22-Mar-10 11:53 
AnswerRe: Form is Flickering Pin
Kristian Sixhøj22-Mar-10 12:00
Kristian Sixhøj22-Mar-10 12:00 
QuestionThe WebBrowser control Pin
BuggingMe22-Mar-10 10:24
BuggingMe22-Mar-10 10:24 
Ive got a simple browser automation project

navigate to the image host
fill in a urlbox
hit the add button
wait for the page to reload
hit submit

The problem is when the page refreshes my code seems to stall, I know the navigated event could be used but that would unnecessarily complicate the code. Can anyone suggest a fix Sleepy | :zzz:

            if (CurrentThread.ReadyState == WebBrowserReadyState.Complete)
            {
                CurrentThread.DocumentCompleted -= new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.ThreadCallback);
}
//fill in textbox
 HtmlElementCollection Buttons = CurrentThread.Document.GetElementsByTagName("input");
                    foreach (HtmlElement Button in Buttons)
                    {
                        if (Button.GetAttribute("type").ToString() == "submit" && (Button.GetAttribute("name").ToString() == "AddList"))
                        {
                            DateTime InitalTime = DateTime.Now;
                            System.TimeSpan TimeDelay = new System.TimeSpan(0, 0, 0, 0, 10000);
                            System.DateTime TimeOut = InitalTime.Add(TimeDelay);
                            while (TimeOut > DateTime.Now)
                            {
                                Button.InvokeMember("click");
                                //browser refreshes now
                                try
                                {
                                    //Wait for page to begin loading
                                    while (CurrentThread.IsBusy != true)
                                    {
                                        //Infinite Loop Here
                                        Application.DoEvents();
                                    } 
                                    //Wait for page to finish loading
                                    while (CurrentThread.IsBusy == true)
                                    {
                                        Application.DoEvents();
                                    }
                                }
                                catch
                                {
                                    MessageBox.Show("error");
                                }
                            }
                        }
                    }
                    HtmlElementCollection PostButtons = CurrentThread.Document.GetElementsByTagName("input");
                    foreach (HtmlElement Button in PostButtons)
                    {
                        MessageBox.Show(Button.GetAttribute("name").ToString());
                        if (Button.GetAttribute("type").ToString() == "submit" && (Button.GetAttribute("name").ToString() == "post"))
                        {
                                Button.InvokeMember("click");
                        }
                    }

Questionrecording sound from speakers Pin
rosin722-Mar-10 9:14
rosin722-Mar-10 9:14 
AnswerRe: recording sound from speakers Pin
DaveyM6922-Mar-10 10:33
professionalDaveyM6922-Mar-10 10:33 
QuestionModify Collection using LINQ Pin
uusheikh22-Mar-10 9:05
uusheikh22-Mar-10 9:05 
AnswerRe: Modify Collection using LINQ Pin
Gideon Engelberth22-Mar-10 9:30
Gideon Engelberth22-Mar-10 9:30 
AnswerRe: Modify Collection using LINQ Pin
Dave Kreskowiak22-Mar-10 10:50
mveDave Kreskowiak22-Mar-10 10:50 
GeneralRe: Modify Collection using LINQ Pin
uusheikh22-Mar-10 16:03
uusheikh22-Mar-10 16:03 
QuestionHow can I receive mail? Pin
Member 621528422-Mar-10 9:02
Member 621528422-Mar-10 9:02 
AnswerRe: How can I receive mail? Pin
Richard MacCutchan22-Mar-10 9:39
mveRichard MacCutchan22-Mar-10 9:39 
AnswerRe: How can I receive mail? Pin
DaveyM6922-Mar-10 10:29
professionalDaveyM6922-Mar-10 10:29 
QuestionRandom Number Question Pin
rmeister2922-Mar-10 7:50
rmeister2922-Mar-10 7:50 
AnswerRe: Random Number Question Pin
harold aptroot22-Mar-10 7:59
harold aptroot22-Mar-10 7:59 
AnswerRe: Random Number Question Pin
Migounette22-Mar-10 8:32
Migounette22-Mar-10 8:32 
Questionuser Friendly Datagrid Pin
Amin shamooni22-Mar-10 7:11
Amin shamooni22-Mar-10 7:11 
AnswerRe: user Friendly Datagrid Pin
PIEBALDconsult22-Mar-10 8:37
mvePIEBALDconsult22-Mar-10 8:37 
Questionhow change buttons messagebox [modified] Pin
Amin shamooni22-Mar-10 7:06
Amin shamooni22-Mar-10 7:06 
AnswerRe: how change buttons messagebox Pin
dan!sh 22-Mar-10 7:08
professional dan!sh 22-Mar-10 7:08 
AnswerRe: how change buttons messagebox Pin
The Man from U.N.C.L.E.22-Mar-10 8:12
The Man from U.N.C.L.E.22-Mar-10 8:12 

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.