Hi all,
I have some code that is sending keys to some input file boxes (this is a work around since you cannot change file input values) (WebBrowser control by the way).... all is well except sendkeys cannot keep up with the next command to click the submit button...
My question is , how do i slow down the next step so sendkeys can catch up... I have tried a timer with no success!!
here is what i have... ( // tabbing through to get to the file inputs)
for
(int a =0; a<6; a++)
{
SendKeys.Send("{tab}");
}
SendKeys.Send(imagebox1.Text);
for (int a = 0; a < 2; a++)
{
SendKeys.Send("{tab}");
}
SendKeys.Send(imagebox2.Text);
for (int a = 0; a < 2; a++)
{
SendKeys.Send("{tab}");
}
SendKeys.Send(imagebox3.Text);
for (int a = 0; a < 2; a++)
{
SendKeys.Send("{tab}");
}
SendKeys.Send(imagebox4.Text);
// right here is where my problem is .. if i comment out chkElem.InvokeMember("click") then send keys is ok and the file inputs populate.. otherwise it submits the form without catching up..
HtmlElement chkElem = doc.GetElementById("submit");
chkElem.Focus();
chkElem.InvokeMember("click");