本文整理汇总了C#中System.Windows.Forms.WebBrowser.Invalidate方法的典型用法代码示例。如果您正苦于以下问题:C# WebBrowser.Invalidate方法的具体用法?C# WebBrowser.Invalidate怎么用?C# WebBrowser.Invalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.WebBrowser
的用法示例。
在下文中一共展示了WebBrowser.Invalidate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillTest
private void FillTest(int count,string path)
{
int currentpos = 10;
const int buttonsize = 150;
int buttonstart = split_Тесты.Panel2.Width - 40 - buttonsize;
int buttonwidth = split_Тесты.Panel2.Width - 40 - buttonstart;
int browserwidth = split_Тесты.Panel2.Width - 45;
for (int i = 0; i < count; i++)
{
WebBrowser b = new WebBrowser();
b.Location = new Point(10, currentpos);
b.IsWebBrowserContextMenuEnabled = false;
b.AllowWebBrowserDrop = false;
b.WebBrowserShortcutsEnabled = false;
b.Url = new Uri(String.Format("file:///{0}", Path.Combine(path,(i+1).ToString(),"main.html")));
b.Visible = true;
b.Name = "WebBrowser" + i.ToString();
b.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
b.Invalidate();
b.Width = browserwidth;
b.Height = 250;
//установка стиля согласно настройкам
settings.ApplyWebBrowserStyle(b);
/* Размер по документу
while (b.Document.Body == null)
{
Application.DoEvents();
}
b.Height = b.Document.Body.ScrollRectangle.Height + 25;*/
b.Parent = split_Тесты.Panel2;
currentpos += b.Height + 5;
TextBox t = new TextBox();
t.Location = new Point(10, currentpos);
t.Width = buttonstart;
t.Name = "TextBox" + (i + 1).ToString();
t.Visible = true;
t.Multiline = false;
t.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
t.Parent = split_Тесты.Panel2;
t.TextChanged += TestTextBoxChanged;
Button btn = new Button();
btn.Location = new Point(buttonstart + 10, currentpos - 1);
btn.Height = t.Height + 2;
btn.Width = buttonwidth;
btn.Name = "Button" + (i + 1).ToString();
btn.Text = "Проверить";
btn.Visible = true;
btn.Anchor = AnchorStyles.Right | AnchorStyles.Top;
btn.Parent = split_Тесты.Panel2;
btn.Click += TestButtonPressed;
currentpos += t.Height + 100;
}
}