form1.h
来自「Visual_C++.NET实用编程百例」· C头文件 代码 · 共 121 行
H
121 行
#pragma once
namespace menu
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Form1 摘要
///
/// 警告: 如果您更改该类的名称,则需要更改
/// 与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的
/// “资源文件名”属性。 否则,
/// 设计器将不能与此窗体关联的
/// 本地化资源正确交互。
/// </summary>
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::LinkLabel * linkLabel1;
private: System::Windows::Forms::LinkLabel * linkLabel2;
private:
/// <summary>
/// 必需的设计器变量。
/// </summary>
System::ComponentModel::Container * components;
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
void InitializeComponent(void)
{
this->linkLabel1 = new System::Windows::Forms::LinkLabel();
this->linkLabel2 = new System::Windows::Forms::LinkLabel();
this->SuspendLayout();
//
// linkLabel1
//
this->linkLabel1->Font = new System::Drawing::Font(S"宋体", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, (System::Byte)134);
this->linkLabel1->LinkArea = System::Windows::Forms::LinkArea(2, 2);
this->linkLabel1->Location = System::Drawing::Point(32, 40);
this->linkLabel1->Name = S"linkLabel1";
this->linkLabel1->Size = System::Drawing::Size(144, 24);
this->linkLabel1->TabIndex = 0;
this->linkLabel1->TabStop = true;
this->linkLabel1->Text = S"单击此处可以打开";
this->linkLabel1->LinkClicked += new System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, linkLabel1_LinkClicked);
//
// linkLabel2
//
this->linkLabel2->Font = new System::Drawing::Font(S"宋体", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, (System::Byte)134);
this->linkLabel2->LinkArea = System::Windows::Forms::LinkArea(0, 4);
this->linkLabel2->Location = System::Drawing::Point(168, 40);
this->linkLabel2->Name = S"linkLabel2";
this->linkLabel2->Size = System::Drawing::Size(128, 16);
this->linkLabel2->TabIndex = 1;
this->linkLabel2->TabStop = true;
this->linkLabel2->Text = S"清华大学的主页";
this->linkLabel2->LinkClicked += new System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, linkLabel2_LinkClicked);
//
// Form1
//
this->AutoScaleBaseSize = System::Drawing::Size(6, 14);
this->ClientSize = System::Drawing::Size(312, 94);
this->Controls->Add(this->linkLabel2);
this->Controls->Add(this->linkLabel1);
this->Name = S"Form1";
this->Text = S"超链接控件";
this->ResumeLayout(false);
}
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
System::Diagnostics::Process* pPro = new Diagnostics::Process ();
pPro->EnableRaisingEvents = false;
pPro->Start ("http://www.tsinghua.edu.cn");
}
private: System::Void linkLabel1_LinkClicked(System::Object * sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs * e)
{
linkLabel1->LinkVisited =true;
System::Diagnostics::Process* pPro = new Diagnostics::Process ();
pPro->EnableRaisingEvents = false;
pPro->Start ("http://www.tsinghua.edu.cn");
}
private: System::Void linkLabel2_LinkClicked(System::Object * sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs * e)
{
linkLabel2->LinkVisited =true;
System::Diagnostics::Process* pPro = new Diagnostics::Process ();
pPro->EnableRaisingEvents = false;
pPro->Start ("http://www.tsinghua.edu.cn");
}
};
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?