本文整理汇总了C#中System.Windows.Forms.HtmlWindow.Confirm方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlWindow.Confirm方法的具体用法?C# HtmlWindow.Confirm怎么用?C# HtmlWindow.Confirm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.HtmlWindow
的用法示例。
在下文中一共展示了HtmlWindow.Confirm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadOrderForm
HtmlWindow orderWindow;
HtmlElement formElement;
private void LoadOrderForm()
{
if (!(webBrowser1.Document == null))
{
HtmlDocument doc = webBrowser1.Document;
orderWindow = doc.Window.OpenNew(new Uri("file://C:\\orderForm.htm"), "");
//!TODO: Perform this in the load event handler!
// Get order form.
HtmlElementCollection elemCollection = doc.All.GetElementsByName("NewOrderForm");
if (elemCollection.Count == 1)
{
formElement = elemCollection[0];
//!TODO: Awaiting DCR
//formElement.AttachEventHandler("onsubmit", new HtmlElementEventHandler(Form_Submit));
}
}
}
private void Form_Submit(object sender, HtmlElementEventArgs e)
{
bool doOrder = orderWindow.Confirm("Once you transmit this order, you cannot cancel it. Submit?");
if (!doOrder)
{
//Cancel the submit.
e.ReturnValue = false;
orderWindow.Alert("Submit cancelled.");
}
}