Exemple #1
0
        //ENTER
        private void addressBar_Url_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (this.mdiTabStrip1.ActiveTab == null)//没有标签页的情况下,新建一个窗口,然后请求网址
                {
                    WebView aForm = new WebView();
                    aForm.MdiParent = this;
                    aForm.WebBrowserContent.Navigate(addressBar_Url.Text.ToString());
                    if (url!=null)
                        addHistory(url, DateTime.Now.ToString(currentCulture));//这里我没有设置这个网页请求是否是有效的的验证
                    aForm.Show();
                }
                else//已有标签页的情况下,直接请求网址
                {
                    WebView webTab = (WebView)this.mdiTabStrip1.ActiveTab.Form;
                    webTab.WebBrowserContent.Navigate(addressBar_Url.Text.ToString());
                    if (url!=null)
                        addHistory(url, DateTime.Now.ToString(currentCulture));//这里我没有设置这个网页请求是否是有效的的验证
                }

            }
        }
Exemple #2
0
 public void UpdateAddressBox(WebView currForm, string urlString)
 {
     if ((WebView)this.mdiTabStrip1.ActiveTab.Form == currForm &&
         !urlString.Equals(this.addressBar_Url.Text, StringComparison.InvariantCultureIgnoreCase))
     {
         this.addressBar_Url.Text = urlString;
     }
     RefreshAddressBar();
 }
Exemple #3
0
 private void addressBar_Go_Click(object sender, EventArgs e)
 {
     if (this.mdiTabStrip1.ActiveTab == null)
     {
         WebView aForm = new WebView();
         aForm.MdiParent = this;
         aForm.WebBrowserContent.Navigate(addressBar_Url.Text.ToString());
         if (url != null)
             addHistory(url, DateTime.Now.ToString(currentCulture));//这里我没有设置这个网页请求是否是有效的的验证
         aForm.Show();
     }
     else
     {
         WebView webTab = (WebView)this.mdiTabStrip1.ActiveTab.Form;
         webTab.WebBrowserContent.Navigate(addressBar_Url.Text.ToString());
         if (url != null)
             addHistory(url, DateTime.Now.ToString(currentCulture));//这里我没有设置这个网页请求是否是有效的的验证
     }
 }
Exemple #4
0
 public ExtendedWebBrowser NewBlankBrowserWindow(bool ab)
 {
     WebView aForm = new WebView();
     aForm.MdiParent = this;
     aForm.WebBrowserContent.Navigate(homePage);
     aForm.Show();
     return aForm.WebBrowserContent;
 }
Exemple #5
0
 private void openInNewTabToolStripMenuItem_Click(object sender, EventArgs e)
 {
     WebView aForm = new WebView();
     aForm.MdiParent = this;
     aForm.WebBrowserContent.Navigate(adress);
     aForm.Show();
 }
Exemple #6
0
 private void NewHomeBrowser()
 {
     WebView aForm = new WebView();
     aForm.MdiParent = this;
     aForm.WebBrowserContent.GoHome();
     aForm.Show();
 }
Exemple #7
0
 //<summary>
 //新的空浏览器窗口
 //</summary>
 private void NewBlankBrowserWindow()
 {
     WebView aForm = new WebView();
     aForm.MdiParent = this;//让这个mdiTabStrip以MainWindow为依靠
     aForm.WebBrowserContent.Navigate(homePage);
     aForm.Show();
     if (url != null)
         addHistory(url, DateTime.Now.ToString(currentCulture));//这里我没有设置这个网页请求是否是有效的的验证
     //aForm.WebBrowserContent.GoHome();
 }
Exemple #8
0
 //<sumamry>
 //这就是传说中的重新打开上次会话内容,不过我还没找出保存多个url的方法,在此只能处理一个网页
 //</summary>
 private void MenuItem_Tools_ReOpen_Click(object sender, EventArgs e)
 {
     XmlDocument myXml = new XmlDocument();
     if (!File.Exists(lastSessionXml))
     {
         return;
     }
     else
     {
         myXml.Load(lastSessionXml);
         XmlNode xe = myXml.SelectSingleNode("LastSession");
         String url = xe.SelectSingleNode("item").InnerText.ToString();
         WebView aForm = new WebView();
         aForm.MdiParent = this;
         aForm.WebBrowserContent.Navigate(url);
         aForm.Show();
     }
 }