本文整理汇总了C#中System.Windows.Forms.HtmlElement.Focus方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlElement.Focus方法的具体用法?C# HtmlElement.Focus怎么用?C# HtmlElement.Focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.HtmlElement
的用法示例。
在下文中一共展示了HtmlElement.Focus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopulateInputFile
async Task PopulateInputFile(HtmlElement file, String photo)
{
file.Focus();
// delay the execution of SendKey to let the Choose File dialog show up
var sendKeyTask = TaskEx.Delay(500).ContinueWith((_) =>
{
// this gets executed when the dialog is visible
SendKeys.SendWait(photo + "{ENTER}");
}, TaskScheduler.FromCurrentSynchronizationContext());
file.InvokeMember("Click"); // this shows up the dialog
await sendKeyTask;
file.RemoveFocus();
// delay continuation to let the Choose File dialog hide
await TaskEx.Delay(500);
}
示例2: timer1_Tick
private void timer1_Tick(object sender, EventArgs e)
{
switch (step)
{
case 1:
step = 0;
toolStep.Text = "Étape : 1";
hotmailer.webBrowser1.Navigate("http://google.com");
hotmailer.Show();
step = 2;
break;
case 2:
step = 0;
toolStep.Text = "Étape : 2";
identity = hotmailer.webBrowser1.Document.GetElementById("identity");
/*
* Modifications for GAF
*
*/
SendKeys.Send("test");
ClearCookies();
WebBrowserHelper.ClearCache();
break;
if (identity != null)
{
// Entre mot de passe
identity.Focus();
SendKeys.Send("loubna");
if (identity.GetAttribute("value") != "loubna")
{
// La page n'était pas chargée
step = 2;
return;
}
// Entre code de campagne.
campaignCode = hotmailer.webBrowser1.Document.GetElementById("campaignCode");
campaignCode.Focus();
SendKeys.SendWait(codeDeCampagne);
while (campaignCode.GetAttribute("value") != codeDeCampagne)
{
campaignCode.Focus();
// Problème quelconque: on efface l'input et recommence.
while (campaignCode.GetAttribute("value") != "")
{
SendKeys.SendWait("{BACKSPACE}");
}
SendKeys.SendWait(codeDeCampagne);
}
// Clique sur une DIV invisble ayant onclick="next();": simule un "{ENTER}"
pressEnter = hotmailer.webBrowser1.Document.GetElementById("pressEnter");
pressEnter.InvokeMember("click");
step = 3;
}
else
{
step = 2;
}
break;
case 3:
step = 0;
toolStep.Text = "Étape : 3";
// Collecte le compte Yahoo
address = hotmailer.webBrowser1.Document.GetElementById("address");
strAddress = address.GetAttribute("value");
if (strAddress == "")
{
// La page n'était pas chargée
step = 3;
return;
}
// Collecte le mot de passe
password = hotmailer.webBrowser1.Document.GetElementById("password");
strPassword = password.GetAttribute("value");
// Collecte le récipient
recipient = hotmailer.webBrowser1.Document.GetElementById("recipient");
strRecipient = recipient.GetAttribute("value");
//.........这里部分代码省略.........
示例3: Focus
public void Focus(HtmlElement h)
{
h.Focus();
}
示例4: Focus
public void Focus(HtmlElement elem)
{
elem.Focus();
}
示例5: InputValue
private void InputValue(HtmlElement element, string value)
{
element.SetAttribute("value", value);
webBrowser.Select();
webBrowser.Focus();
element.Focus();
System.Windows.Forms.SendKeys.Send("{tab}");
System.Windows.Forms.SendKeys.Send(" ");
}