📄 formfindnreplace.h
字号:
#pragma once
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
namespace LeastLIDE {
/// <summary>
/// Summary for FormFindNReplace
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public ref class FormFindNReplace : public System::Windows::Forms::Form
{
public:
FormFindNReplace(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~FormFindNReplace()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::GroupBox^ groupBox1;
private: System::Windows::Forms::ComboBox^ comboBoxFind;
protected:
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::ComboBox^ comboBoxReplace;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Button^ buttonFind;
private: System::Windows::Forms::Button^ buttonReplaceAll;
private: System::Windows::Forms::Button^ buttonClose;
private: System::Windows::Forms::Button^ buttonReplace;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma 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>
void InitializeComponent(void)
{
this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
this->comboBoxReplace = (gcnew System::Windows::Forms::ComboBox());
this->label2 = (gcnew System::Windows::Forms::Label());
this->comboBoxFind = (gcnew System::Windows::Forms::ComboBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->buttonFind = (gcnew System::Windows::Forms::Button());
this->buttonReplaceAll = (gcnew System::Windows::Forms::Button());
this->buttonClose = (gcnew System::Windows::Forms::Button());
this->buttonReplace = (gcnew System::Windows::Forms::Button());
this->groupBox1->SuspendLayout();
this->SuspendLayout();
//
// groupBox1
//
this->groupBox1->Controls->Add(this->comboBoxReplace);
this->groupBox1->Controls->Add(this->label2);
this->groupBox1->Controls->Add(this->comboBoxFind);
this->groupBox1->Controls->Add(this->label1);
this->groupBox1->Location = System::Drawing::Point(-8, 1);
this->groupBox1->Name = L"groupBox1";
this->groupBox1->Size = System::Drawing::Size(400, 121);
this->groupBox1->TabIndex = 0;
this->groupBox1->TabStop = false;
//
// comboBoxReplace
//
this->comboBoxReplace->AutoCompleteMode = System::Windows::Forms::AutoCompleteMode::SuggestAppend;
this->comboBoxReplace->AutoCompleteSource = System::Windows::Forms::AutoCompleteSource::RecentlyUsedList;
this->comboBoxReplace->FormattingEnabled = true;
this->comboBoxReplace->Location = System::Drawing::Point(23, 76);
this->comboBoxReplace->Name = L"comboBoxReplace";
this->comboBoxReplace->Size = System::Drawing::Size(286, 20);
this->comboBoxReplace->TabIndex = 3;
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(21, 60);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(47, 12);
this->label2->TabIndex = 2;
this->label2->Text = L"替换成:";
//
// comboBoxFind
//
this->comboBoxFind->AutoCompleteMode = System::Windows::Forms::AutoCompleteMode::SuggestAppend;
this->comboBoxFind->AutoCompleteSource = System::Windows::Forms::AutoCompleteSource::RecentlyUsedList;
this->comboBoxFind->FormattingEnabled = true;
this->comboBoxFind->Location = System::Drawing::Point(23, 28);
this->comboBoxFind->Name = L"comboBoxFind";
this->comboBoxFind->Size = System::Drawing::Size(286, 20);
this->comboBoxFind->TabIndex = 1;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(21, 12);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(35, 12);
this->label1->TabIndex = 0;
this->label1->Text = L"查找:";
//
// buttonFind
//
this->buttonFind->Location = System::Drawing::Point(301, 129);
this->buttonFind->Name = L"buttonFind";
this->buttonFind->Size = System::Drawing::Size(75, 23);
this->buttonFind->TabIndex = 1;
this->buttonFind->Text = L"查找下一个";
this->buttonFind->UseVisualStyleBackColor = true;
this->buttonFind->Click += gcnew System::EventHandler(this, &FormFindNReplace::buttonFind_Click);
//
// buttonReplaceAll
//
this->buttonReplaceAll->Location = System::Drawing::Point(132, 129);
this->buttonReplaceAll->Name = L"buttonReplaceAll";
this->buttonReplaceAll->Size = System::Drawing::Size(82, 23);
this->buttonReplaceAll->TabIndex = 2;
this->buttonReplaceAll->Text = L"全部替换";
this->buttonReplaceAll->UseVisualStyleBackColor = true;
this->buttonReplaceAll->Click += gcnew System::EventHandler(this, &FormFindNReplace::buttonReplaceAll_Click);
//
// buttonClose
//
this->buttonClose->Location = System::Drawing::Point(15, 129);
this->buttonClose->Name = L"buttonClose";
this->buttonClose->Size = System::Drawing::Size(75, 23);
this->buttonClose->TabIndex = 3;
this->buttonClose->Text = L"关闭";
this->buttonClose->UseVisualStyleBackColor = true;
this->buttonClose->Click += gcnew System::EventHandler(this, &FormFindNReplace::buttonClose_Click);
//
// buttonReplace
//
this->buttonReplace->Location = System::Drawing::Point(220, 129);
this->buttonReplace->Name = L"buttonReplace";
this->buttonReplace->Size = System::Drawing::Size(75, 23);
this->buttonReplace->TabIndex = 4;
this->buttonReplace->Text = L"替换";
this->buttonReplace->UseVisualStyleBackColor = true;
this->buttonReplace->Click += gcnew System::EventHandler(this, &FormFindNReplace::buttonReplace_Click);
//
// FormFindNReplace
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(388, 161);
this->Controls->Add(this->buttonReplace);
this->Controls->Add(this->buttonClose);
this->Controls->Add(this->buttonReplaceAll);
this->Controls->Add(this->buttonFind);
this->Controls->Add(this->groupBox1);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
this->MaximizeBox = false;
this->Name = L"FormFindNReplace";
this->Text = L"Find And Replace";
this->Load += gcnew System::EventHandler(this, &FormFindNReplace::FormFindNReplace_Load);
this->groupBox1->ResumeLayout(false);
this->groupBox1->PerformLayout();
this->ResumeLayout(false);
}
#pragma endregion
private:
int startPos;
private:
System::Void buttonFind_Click(System::Object^ sender, System::EventArgs^ e);
System::Void buttonReplace_Click(System::Object^ sender, System::EventArgs^ e);
System::Void buttonClose_Click(System::Object^ sender, System::EventArgs^ e);
System::Void buttonReplaceAll_Click(System::Object^ sender, System::EventArgs^ e);
private:
System::Void FormFindNReplace_Load(System::Object^ sender, System::EventArgs^ e) {
startPos = 0;
}
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -