Browse Source

完善UI,完成查看--》工具栏功能

CaptB 4 months ago
parent
commit
038fb0f579
2 changed files with 22 additions and 3 deletions
  1. 3 1
      Form1.Designer.cs
  2. 19 2
      Form1.cs

+ 3 - 1
Form1.Designer.cs

@@ -211,6 +211,7 @@
             textBox1.BorderStyle = BorderStyle.FixedSingle;
             textBox1.BorderStyle = BorderStyle.FixedSingle;
             textBox1.Location = new Point(481, 30);
             textBox1.Location = new Point(481, 30);
             textBox1.Name = "textBox1";
             textBox1.Name = "textBox1";
+            textBox1.PlaceholderText = "Microsoft Bing 搜索...";
             textBox1.Size = new Size(261, 23);
             textBox1.Size = new Size(261, 23);
             textBox1.TabIndex = 11;
             textBox1.TabIndex = 11;
             // 
             // 
@@ -430,6 +431,7 @@
             工具栏ToolStripMenuItem.Name = "工具栏ToolStripMenuItem";
             工具栏ToolStripMenuItem.Name = "工具栏ToolStripMenuItem";
             工具栏ToolStripMenuItem.Size = new Size(120, 22);
             工具栏ToolStripMenuItem.Size = new Size(120, 22);
             工具栏ToolStripMenuItem.Text = "工具栏";
             工具栏ToolStripMenuItem.Text = "工具栏";
+            工具栏ToolStripMenuItem.CheckStateChanged += 工具栏ToolStripMenuItem_CheckStateChanged;
             // 
             // 
             // toolStripSeparator8
             // toolStripSeparator8
             // 
             // 
@@ -562,7 +564,7 @@
             webView21.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
             webView21.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
             webView21.CreationProperties = null;
             webView21.CreationProperties = null;
             webView21.DefaultBackgroundColor = Color.White;
             webView21.DefaultBackgroundColor = Color.White;
-            webView21.Location = new Point(12, 60);
+            webView21.Location = new Point(12, 58);
             webView21.Name = "webView21";
             webView21.Name = "webView21";
             webView21.Size = new Size(760, 476);
             webView21.Size = new Size(760, 476);
             webView21.TabIndex = 14;
             webView21.TabIndex = 14;

+ 19 - 2
Form1.cs

@@ -179,8 +179,11 @@ namespace EdgeVoyager
 
 
         private void search_button_Click(object sender, EventArgs e)
         private void search_button_Click(object sender, EventArgs e)
         {
         {
-            webView21.CoreWebView2.Navigate("https://cn.bing.com/search?q=" + textBox1.Text);
-            webView21.CoreWebView2.Profile.PreferredColorScheme = CoreWebView2PreferredColorScheme.Light;
+            if(textBox1.Text.Length > 0)
+            {
+                webView21.CoreWebView2.Navigate("https://cn.bing.com/search?q=" + textBox1.Text);
+                webView21.CoreWebView2.Profile.PreferredColorScheme = CoreWebView2PreferredColorScheme.Light;
+            }
         }
         }
 
 
         private void webView21_NavigationStarting(object sender, CoreWebView2NavigationStartingEventArgs e)
         private void webView21_NavigationStarting(object sender, CoreWebView2NavigationStartingEventArgs e)
@@ -326,5 +329,19 @@ namespace EdgeVoyager
             string requestUri = e.Request.Uri;
             string requestUri = e.Request.Uri;
             StatusLabel.Text = "헝헹栗都:" + requestUri;
             StatusLabel.Text = "헝헹栗都:" + requestUri;
         }
         }
+
+        private void 묏야으ToolStripMenuItem_CheckStateChanged(object sender, EventArgs e)
+        {
+            if (묏야으ToolStripMenuItem.Checked == true)
+            {
+                statusStrip1.Visible = true;
+                webView21.Height = webView21.Height - 23;
+            }
+            else
+            {
+                statusStrip1.Visible = false;
+                webView21.Height = webView21.Height + 23;
+            }
+        }
     }
     }
 }
 }