📄 balloonsearch.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using DevComponents.DotNetBar;
namespace Notepad
{
/// <summary>
/// Summary description for BalloonSearch.
/// </summary>
public class BalloonSearch : DevComponents.DotNetBar.Balloon
{
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.LinkLabel linkLabel1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public BalloonSearch()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(BalloonSearch));
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox1.Location = new System.Drawing.Point(72, 48);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(160, 20);
this.textBox1.TabIndex = 0;
this.textBox1.Text = "";
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(116, 72);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(72, 24);
this.button1.TabIndex = 1;
this.button1.Text = "&Search";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label1.Location = new System.Drawing.Point(72, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(112, 16);
this.label1.TabIndex = 2;
this.label1.Text = "Find what:";
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(8, 24);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(64, 64);
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.BackColor = System.Drawing.Color.Transparent;
this.linkLabel1.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.linkLabel1.Location = new System.Drawing.Point(8, 88);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(61, 11);
this.linkLabel1.TabIndex = 4;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "Switch Style";
this.linkLabel1.VisitedLinkColor = System.Drawing.Color.Blue;
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// BalloonSearch
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(240, 104);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.linkLabel1,
this.pictureBox1,
this.label1,
this.button1,
this.textBox1});
this.Location = new System.Drawing.Point(0, 0);
this.Name = "BalloonSearch";
this.Activated += new System.EventHandler(this.BalloonSearch_Activated);
this.Deactivate += new System.EventHandler(this.BalloonSearch_Deactivate);
this.ResumeLayout(false);
}
#endregion
private void BalloonSearch_Deactivate(object sender, System.EventArgs e)
{
this.Opacity=.75;
}
private void BalloonSearch_Activated(object sender, System.EventArgs e)
{
this.Opacity=1;
}
private void button1_Click(object sender, System.EventArgs e)
{
if(this.Owner!=null)
{
if(textBox1.Text=="")
MessageBox.Show("Please enter search text.","Search",MessageBoxButtons.OK,MessageBoxIcon.Information);
else
((frmMain)this.Owner).SearchActiveDocument(textBox1.Text);
}
}
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
if(this.BackColor==SystemColors.Info)
{
// Switch to Office 2003 style colors...
ColorScheme scheme=new ColorScheme(eDotNetBarStyle.Office2003);
this.BackColor=scheme.ItemCheckedBackground;
this.BackColor2=scheme.ItemCheckedBackground2;
this.BackColorGradientAngle=scheme.ItemCheckedBackgroundGradientAngle;
this.Refresh();
}
else
{
this.BackColor=SystemColors.Info;
this.BackColor2=Color.Empty;
this.Refresh();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -