本文整理汇总了C#中WebBrowser.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# WebBrowser.BringToFront方法的具体用法?C# WebBrowser.BringToFront怎么用?C# WebBrowser.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebBrowser
的用法示例。
在下文中一共展示了WebBrowser.BringToFront方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildSubURLTabs
public void BuildSubURLTabs(object sender, EventArgs ev, URLTabPlugin.TabTypes tt)
{
if (sender != null)
{
/* Create a panel, find the parent form and maximize it */
Panel p = (Panel)sender;
TabPage c = (TabPage)p.Parent;
Form f = c.FindForm();
f.WindowState = FormWindowState.Maximized;
TabControl tc = new TabControl();
p.Controls.Add(tc);
tc.Dock = DockStyle.Fill;
/* Create a list of URLTabs */
this.propertyString = "URLTabPlugin+" + c.Text.Replace(" ", "_");
string result = objHost.GetSQL("SELECT Value FROM properties where Name LIKE '%" + this.propertyString + "%'");
var UTP = Activator.CreateInstance<List<URLTabPlugin>>();
if (result != "-9999")
{
using (var memoryStream = new MemoryStream(Encoding.Unicode.GetBytes(result)))
{
var serializer = new DataContractJsonSerializer(UTP.GetType());
UTP = (List<URLTabPlugin>)serializer.ReadObject(memoryStream);
}
foreach (URLTabPlugin utp in UTP)
{
if (utp.TabType == tt)
{
TabPage tp = new TabPage(utp.TabLabel);
tc.Controls.Add(tp);
tp.Dock = DockStyle.Fill;
tp.BringToFront();
WebBrowser wb = new WebBrowser();
wb.AllowNavigation = true;
wb.AllowWebBrowserDrop = false;
wb.ScriptErrorsSuppressed = true;
wb.ScrollBarsEnabled = true;
wb.IsWebBrowserContextMenuEnabled = true;
tp.Controls.Add(wb);
wb.Dock = DockStyle.Fill;
wb.BringToFront();
wb.Navigate(utp.TabUrl);
wb.Refresh();
}
}
}
/* Build the config tab */
TabPage tconfig = new TabPage("Config");
tc.Controls.Add(tconfig);
tconfig.Dock = DockStyle.Fill;
/* Dynamic flow layout to hold the buttons */
FlowLayoutPanel buttonFlowLayoutPanel = new FlowLayoutPanel();
buttonFlowLayoutPanel.BringToFront();
buttonFlowLayoutPanel.FlowDirection = FlowDirection.LeftToRight;
buttonFlowLayoutPanel.Location = new System.Drawing.Point(8, 10);
buttonFlowLayoutPanel.Size = new System.Drawing.Size(510, 32);
tconfig.Controls.Add(buttonFlowLayoutPanel);
Button btnSaveConfig = new Button();
btnSaveConfig.Text = "Save Config";
btnSaveConfig.Click += new EventHandler(btnSaveConfig_Click);
Button btnAddTab = new Button();
btnAddTab.Text = "Add Tab";
btnAddTab.Click += new EventHandler(btnAddTab_Click);
buttonFlowLayoutPanel.Controls.Add(btnSaveConfig);
buttonFlowLayoutPanel.Controls.Add(btnAddTab);
/* Dynamic Flow Layout to hold taburlconfigs */
dynamicFlowLayoutPanel = new FlowLayoutPanel();
dynamicFlowLayoutPanel.BringToFront();
dynamicFlowLayoutPanel.FlowDirection = FlowDirection.TopDown;
dynamicFlowLayoutPanel.Location = new System.Drawing.Point(0, 40);
dynamicFlowLayoutPanel.Size = new System.Drawing.Size(510,600);
dynamicFlowLayoutPanel.AutoScroll = true;
dynamicFlowLayoutPanel.WrapContents = false;
tconfig.Controls.Add(dynamicFlowLayoutPanel);
string results = objHost.GetSQL("SELECT Value FROM properties where Name LIKE '%" + propertyString + "%'");
if (results != "-9999")
{
List<string> TabsCompleted = new List<string>();
/* Rewrite, this doesn't make sense. Deserialize it instead and loop through those results. */
foreach (URLTabPlugin utp in UTP)
{
URLTabPluginConfigTab utpct;
// If the tab isn't in the list yet, create it
if (TabsCompleted.IndexOf(utp.TabLabel) < 0)
{
TabsCompleted.Add(utp.TabLabel);
utpct = new URLTabPluginConfigTab();
//.........这里部分代码省略.........