LinkLabel イベント


関連項目
LinkLabel クラスSystem.Windows.Forms 名前空間
Label クラス
LinkLabelLinkClickedEventArgs
LinkLabel.Link
LinkLabel.LinkCollection
ToolStripLabel
LinkLabel クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

<ComVisibleAttribute(True)> _ <ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _ Public Class LinkLabel Inherits Label Implements IButtonControl
[ComVisibleAttribute(true)] [ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] public class LinkLabel : Label, IButtonControl
[ComVisibleAttribute(true)] [ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] public ref class LinkLabel : public Label, IButtonControl

ToolStripLabel コントロールは、Label コントロールおよび LinkLabel コントロールの後継となるコントロールであり、新しい機能が追加されています。ただし、下位互換性を維持し、必要に応じて今後も使用できるように、Label コントロールおよび LinkLabel コントロールはいずれも廃止されずに残されています。
LinkLabel コントロールは、ハイパーリンクを表示できるという点を除き、Label コントロールと似ています。このコントロールのテキストには、複数のハイパーリンクを指定できます。各ハイパーリンクを使用して、アプリケーション内で異なる操作を実行できます。たとえば、ハイパーリンクを使用して、Microsoft Internet Explorer で Web サイトを表示したり、アプリケーションに関連付けられているログ ファイルを読み込んだりできます。
LinkLabel コントロールに表示される各ハイパーリンクは、LinkLabel.Link クラスのインスタンスです。LinkLabel.Link クラスは、ハイパーリンクの表示に関する情報、状態、および位置を定義します。また、LinkLabel.Link クラスの LinkData プロパティを使用すると、表示する URL などの情報をハイパーリンクに関連付けることができます。ユーザーがコントロール内のハイパーリンクをクリックすると、LinkClicked イベントが発生し、クリックされたハイパーリンクを表す LinkLabel.Link オブジェクトが、イベント ハンドラにパラメータとして渡される LinkLabelLinkClickedEventArgs オブジェクトの一部として渡されます。このオブジェクトを使用して、ユーザーがクリックしたハイパーリンクに関連付けられている LinkLabel.Link オブジェクトを取得できます。LinkLabel コントロール内に含まれているすべてのハイパーリンクは、そのコントロールが格納されている LinkLabel.LinkCollection クラスのインスタンスに格納されます。
LinkLabel コントロールにハイパーリンクを追加するには 2 つの方法があります。最も簡単な方法は、LinkArea を指定し、そのオブジェクトを LinkArea プロパティに割り当てる方法です。この方法では、コントロールのテキスト内に 1 つのハイパーリンクを指定できます。複数のハイパーリンクを追加するには、Links プロパティを使用して LinkLabel.LinkCollection クラスにアクセスし、そのコレクションの Add メソッドを使用します。
LinkLabel コントロールを作成すると、LinkLabel コントロールのテキスト全体を含む既定のハイパーリンクが LinkLabel.LinkCollection に追加されます。LinkArea プロパティで新しいリンク領域を指定して、この既定のリンクをオーバーライドするか、LinkLabel.LinkCollection の Add メソッドを使用してリンクを指定できます。既定のハイパーリンクは、LinkLabel.LinkCollection クラスの Remove メソッドを使用して削除することもできます。
LinkLabel は、コントロール内のハイパーリンクの外観を定義するために使用できる多くのプロパティを提供します。ActiveLinkColor、DisabledLinkColor、LinkColor、VisitedLinkColor の各プロパティは、さまざまな状態のハイパーリンクを表示するときに使用する色を定義します。LinkBehavior プロパティは、ハイパーリンクに関連付けられている下線の表示方法を定義します。

複数の LinkArea セクションが定義されている LinkLabel クラスを使用して、フォームにラベルを表示する例を次に示します。AutoSize、LinkBehavior、DisabledLinkColor、LinkColor、および VisitedLinkColor などの各プロパティを設定して LinkLabel の外観をカスタマイズする例を次に示します。最初の LinkArea は、LinkLabel.LinkArea プロパティを使用して指定されます。追加のリンクは、LinkLabel.LinkCollection.Add メソッドを使用して LinkLabel に追加されます。この例では、LinkClicked イベントを使用して、Web ブラウザを起動してハイパーリンクにアクセスし、その他のリンクを示す MessageBox を表示しています。
Imports System Imports System.Drawing Imports System.Windows.Forms Public NotInheritable Class Form1 Inherits System.Windows.Forms.Form Friend WithEvents LinkLabel1 As System.Windows.Forms.LinkLabel <System.STAThread()> _ Public Shared Sub Main() System.Windows.Forms.Application.Run(New Form1) End Sub 'Main Public Sub New() MyBase.New() Me.LinkLabel1 = New System.Windows.Forms.LinkLabel ' Configure the LinkLabel's size and location. Specify that the ' size should be automatically determined by the content. Me.linkLabel1.Location = New System.Drawing.Point(34, 56) Me.linkLabel1.Size = New System.Drawing.Size(224, 16) Me.linkLabel1.AutoSize = True ' Configure the appearance. ' Set the DisabledLinkColor so that a disabled link will show up against the form's background. Me.linkLabel1.DisabledLinkColor = System.Drawing.Color.Red Me.linkLabel1.VisitedLinkColor = System.Drawing.Color.Blue Me.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline Me.linkLabel1.LinkColor = System.Drawing.Color.Navy Me.linkLabel1.TabIndex = 0 Me.linkLabel1.TabStop = True ' Identify what the first Link is. Me.linkLabel1.LinkArea = New System.Windows.Forms.LinkArea(0, 8) ' Identify that the first link is visited already. Me.linkLabel1.Links(0).Visited = true ' Set the Text property to a string. Me.linkLabel1.Text = "Register Online. Visit Microsoft. Visit MSN." ' Create new links using the Add method of the LinkCollection class. ' Underline the appropriate words in the LinkLabel's Text property. ' The words 'Register', 'Microsoft', and 'MSN' will ' all be underlined and behave as hyperlinks. ' First check that the Text property is long enough to accommodate ' the desired hyperlinked areas. If it's not, don't add hyperlinks. If Me.LinkLabel1.Text.Length >= 45 Then Me.LinkLabel1.Links(0).LinkData = "Register" Me.LinkLabel1.Links.Add(24, 9, "www.microsoft.com") Me.LinkLabel1.Links.Add(42, 3, "www.msn.com") ' The second link is disabled and will appear as red. Me.linkLabel1.Links(1).Enabled = False End If ' Set up how the form should be displayed and adds the controls to the form. Me.ClientSize = New System.Drawing.Size(292, 266) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.LinkLabel1}) Me.Text = "Link Label Example" End Sub Private Sub linkLabel1_LinkClicked(ByVal sender As Object, _ ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked ' Determine which link was clicked within the LinkLabel. Me.LinkLabel1.Links(LinkLabel1.Links.IndexOf(e.Link)).Visited = True ' Displays the appropriate link based on the value of the LinkData property of the Link object. Dim target As String = CType(e.Link.LinkData, String) ' If the value looks like a URL, navigate to it. ' Otherwise, display it in a message box. If (Nothing <> target) And (target.StartsWith("www")) Then System.Diagnostics.Process.Start(target) Else MessageBox.Show(("Item clicked: " + target)) End If End Sub End Class
using System; using System.Drawing; using System.Windows.Forms; public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.LinkLabel linkLabel1; [STAThread] static void Main() { Application.Run(new Form1()); } public Form1() { // Create the LinkLabel. this.linkLabel1 = new System.Windows.Forms.LinkLabel(); // Configure the LinkLabel's size and location. Specify that the // size should be automatically determined by the content. this.linkLabel1.Location = new System.Drawing.Point(34, 56); this.linkLabel1.Size = new System.Drawing.Size(224, 16); this.linkLabel1.AutoSize = true; // Configure the appearance. // Set the DisabledLinkColor so that a disabled link will show up against the form's background. this.linkLabel1.DisabledLinkColor = System.Drawing.Color.Red; this.linkLabel1.VisitedLinkColor = System.Drawing.Color.Blue; this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; this.linkLabel1.LinkColor = System.Drawing.Color.Navy; this.linkLabel1.TabIndex = 0; this.linkLabel1.TabStop = true; // Add an event handler to do something when the links are clicked. this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); // Identify what the first Link is. this.linkLabel1.LinkArea = new System.Windows.Forms.LinkArea(0, 8); // Identify that the first link is visited already. this.linkLabel1.Links[0].Visited = true; // Set the Text property to a string. this.linkLabel1.Text = "Register Online. Visit Microsoft. Visit MSN."; // Create new links using the Add method of the LinkCollection class. // Underline the appropriate words in the LinkLabel's Text property. // The words 'Register', 'Microsoft', and 'MSN' will // all be underlined and behave as hyperlinks. // First check that the Text property is long enough to accommodate // the desired hyperlinked areas. If it's not, don't add hyperlinks. if(this.linkLabel1.Text.Length >= 45) { this.linkLabel1.Links[0].LinkData = "Register"; this.linkLabel1.Links.Add(24, 9, "www.microsoft.com"); this.linkLabel1.Links.Add(42, 3, "www.msn.com"); // The second link is disabled and will appear as red. this.linkLabel1.Links[1].Enabled = false; } // Set up how the form should be displayed and add the controls to the form. this.ClientSize = new System.Drawing.Size(292, 266); this.Controls.AddRange(new System.Windows.Forms.Control[] {this.linkLabel1}); this.Text = "Link Label Example"; } private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { // Determine which link was clicked within the LinkLabel. this.linkLabel1.Links[linkLabel1.Links.IndexOf(e.Link)].Visited = true; // Display the appropriate link based on the value of the // LinkData property of the Link object. string target = e.Link.LinkData as string; // If the value looks like a URL, navigate to it. // Otherwise, display it in a message box. if(null != target && target.StartsWith("www")) { System.Diagnostics.Process.Start(target); } else { MessageBox.Show("Item clicked: " + target); } } }
#using <System.dll> #using <System.Windows.Forms.dll> #using <System.Drawing.dll> using namespace System; using namespace System::Drawing; using namespace System::Windows::Forms; public ref class Form1: public System::Windows::Forms::Form { private: System::Windows::Forms::LinkLabel^ linkLabel1; public: Form1() { // Create the LinkLabel. this->linkLabel1 = gcnew System::Windows::Forms::LinkLabel; // Configure the LinkLabel's size and location. Specify that the // size should be automatically determined by the content. this->linkLabel1->Location = System::Drawing::Point( 34, 56 ); this->linkLabel1->Size = System::Drawing::Size( 224, 16 ); this->linkLabel1->AutoSize = true; // Configure the appearance. this->linkLabel1->DisabledLinkColor = System::Drawing::Color::Red; this->linkLabel1->VisitedLinkColor = System::Drawing::Color::Blue; this->linkLabel1->LinkBehavior = System::Windows::Forms::LinkBehavior::HoverUnderline; this->linkLabel1->LinkColor = System::Drawing::Color::Navy; this->linkLabel1->TabIndex = 0; this->linkLabel1->TabStop = true; // Add an event handler to do something when the links are clicked. this->linkLabel1->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler( this, &Form1::linkLabel1_LinkClicked ); // Identify what the first Link is. this->linkLabel1->LinkArea = System::Windows::Forms::LinkArea( 0, 8 ); // Identify that the first link is visited already. this->linkLabel1->Links[ 0 ]->Visited = true; // Set the Text property to a String*. this->linkLabel1->Text = "Register Online. Visit Microsoft. Visit MSN."; // Create new links using the Add method of the LinkCollection class. // Underline the appropriate words in the LinkLabel's Text property. // The words 'Register', 'Microsoft', and 'MSN' will // all be underlined and behave as hyperlinks. // First check that the Text property is long enough to accommodate // the desired hyperlinked areas. If it's not, don't add hyperlinks. if ( this->linkLabel1->Text->Length >= 45 ) { this->linkLabel1->Links[ 0 ]->LinkData = "Register"; this->linkLabel1->Links->Add( 24, 9, "www.microsoft.com" ); this->linkLabel1->Links->Add( 42, 3, "www.msn.com" ); this->linkLabel1->Links[ 1 ]->Enabled = false; } // Set up how the form should be displayed and add the controls to the form. this->ClientSize = System::Drawing::Size( 292, 266 ); array<System::Windows::Forms::Control^>^temp0 = {this->linkLabel1}; this->Controls->AddRange( temp0 ); this->Text = "Link Label Example"; } private: void linkLabel1_LinkClicked( Object^ /*sender*/, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e ) { // Determine which link was clicked within the LinkLabel. this->linkLabel1->Links[ linkLabel1->Links->IndexOf( e->Link ) ]->Visited = true; // Display the appropriate link based on the value of the // LinkData property of the Link Object*. String^ target = dynamic_cast<String^>(e->Link->LinkData); // If the value looks like a URL, navigate to it. // Otherwise, display it in a message box. if ( nullptr != target && target->StartsWith( "www" ) ) { System::Diagnostics::Process::Start( target ); } else { MessageBox::Show( "Item clicked: {0}", target ); } } }; [STAThread] int main() { Application::Run( gcnew Form1 ); }
import System.*; import System.Drawing.*; import System.Windows.Forms.*; public class Form1 extends System.Windows.Forms.Form { private System.Windows.Forms.LinkLabel linkLabel1; /** @attribute STAThread() */ public static void main(String[] args) { Application.Run(new Form1()); } //main public Form1() { // Create the LinkLabel. this.linkLabel1 = new System.Windows.Forms.LinkLabel(); // Configure the LinkLabel's size and location. Specify that the // size should be automatically determined by the content. this.linkLabel1.set_Location(new System.Drawing.Point(34, 56)); this.linkLabel1.set_Size(new System.Drawing.Size(224, 16)); this.linkLabel1.set_AutoSize(true); // Configure the appearance. // Set the DisabledLinkColor so that a disabled link will show up // against the form's background. this.linkLabel1.set_DisabledLinkColor(System.Drawing.Color.get_Red()); this.linkLabel1.set_VisitedLinkColor(System.Drawing.Color.get_Blue()); this.linkLabel1.set_LinkBehavior( System.Windows.Forms.LinkBehavior.HoverUnderline); this.linkLabel1.set_LinkColor(System.Drawing.Color.get_Navy()); this.linkLabel1.set_TabIndex(0); this.linkLabel1.set_TabStop(true); // Add an event handler to do something when the links are clicked. this.linkLabel1.add_LinkClicked(new System.Windows.Forms. LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked)); // Identify what the first Link is. this.linkLabel1.set_LinkArea(new System.Windows.Forms.LinkArea(0, 8)); // Identify that the first link is visited already. this.linkLabel1.get_Links().get_Item(0).set_Visited(true); // Set the Text property to a string. this.linkLabel1.set_Text("Register Online. Visit Microsoft." + " Visit MSN."); // Create new links using the Add method of the LinkCollection class. // Underline the appropriate words in the LinkLabel's Text property. // The words 'Register', 'Microsoft', and 'MSN' will // all be underlined and behave as hyperlinks. // First check that the Text property is long enough to accommodate // the desired hyperlinked areas. If it's not, don't add hyperlinks. if (this.linkLabel1.get_Text().get_Length() >= 45) { this.linkLabel1.get_Links().get_Item(0).set_LinkData("Register"); this.linkLabel1.get_Links().Add(24, 9, "www.microsoft.com"); this.linkLabel1.get_Links().Add(42, 3, "www.msn.com"); // The second link is disabled and will appear as red. this.linkLabel1.get_Links().get_Item(1).set_Enabled(false); } // Set up how the form should be displayed and add the controls to // the form. this.set_ClientSize(new System.Drawing.Size(292, 266)); this.get_Controls().AddRange(new System.Windows.Forms.Control[] { this.linkLabel1 }); this.set_Text("Link Label Example"); } //Form1 private void linkLabel1_LinkClicked(Object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { // Determine which link was clicked within the LinkLabel. this.linkLabel1.get_Links().get_Item(linkLabel1.get_Links(). IndexOf(e.get_Link())).set_Visited(true); // Display the appropriate link based on the value of the // LinkData property of the Link object. String target = (String)e.get_Link().get_LinkData(); // If the value looks like a URL, navigate to it. // Otherwise, display it in a message box. if (null != target && target.StartsWith("www")) { System.Diagnostics.Process.Start(target); } else { MessageBox.Show("Item clicked: " + target); } } //linkLabel1_LinkClicked } //Form1

System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.Label
System.Windows.Forms.LinkLabel


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


LinkLabel コンストラクタ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


複数の LinkArea セクションが定義されている LinkLabel クラスを使用して、フォームにラベルを表示する例を次に示します。AutoSize、LinkBehavior、DisabledLinkColor、LinkColor、および VisitedLinkColor などの各プロパティを設定して LinkLabel の外観をカスタマイズする例を次に示します。最初の LinkArea は、LinkLabel.LinkArea プロパティを使用して指定されます。追加のリンクは、LinkLabel.LinkCollection.Add メソッドを使用して LinkLabel に追加されます。この例では、LinkClicked イベントを使用して、Web ブラウザを起動してハイパーリンクにアクセスし、その他のリンクを示す MessageBox を表示しています。
Imports System Imports System.Drawing Imports System.Windows.Forms Public NotInheritable Class Form1 Inherits System.Windows.Forms.Form Friend WithEvents LinkLabel1 As System.Windows.Forms.LinkLabel <System.STAThread()> _ Public Shared Sub Main() System.Windows.Forms.Application.Run(New Form1) End Sub 'Main Public Sub New() MyBase.New() Me.LinkLabel1 = New System.Windows.Forms.LinkLabel ' Configure the LinkLabel's size and location. Specify that the ' size should be automatically determined by the content. Me.linkLabel1.Location = New System.Drawing.Point(34, 56) Me.linkLabel1.Size = New System.Drawing.Size(224, 16) Me.linkLabel1.AutoSize = True ' Configure the appearance. ' Set the DisabledLinkColor so that a disabled link will show up against the form's background. Me.linkLabel1.DisabledLinkColor = System.Drawing.Color.Red Me.linkLabel1.VisitedLinkColor = System.Drawing.Color.Blue Me.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline Me.linkLabel1.LinkColor = System.Drawing.Color.Navy Me.linkLabel1.TabIndex = 0 Me.linkLabel1.TabStop = True ' Identify what the first Link is. Me.linkLabel1.LinkArea = New System.Windows.Forms.LinkArea(0, 8) ' Identify that the first link is visited already. Me.linkLabel1.Links(0).Visited = true ' Set the Text property to a string. Me.linkLabel1.Text = "Register Online. Visit Microsoft. Visit MSN." ' Create new links using the Add method of the LinkCollection class. ' Underline the appropriate words in the LinkLabel's Text property. ' The words 'Register', 'Microsoft', and 'MSN' will ' all be underlined and behave as hyperlinks. ' First check that the Text property is long enough to accommodate ' the desired hyperlinked areas. If it's not, don't add hyperlinks. If Me.LinkLabel1.Text.Length >= 45 Then Me.LinkLabel1.Links(0).LinkData = "Register" Me.LinkLabel1.Links.Add(24, 9, "www.microsoft.com") Me.LinkLabel1.Links.Add(42, 3, "www.msn.com") ' The second link is disabled and will appear as red. Me.linkLabel1.Links(1).Enabled = False End If ' Set up how the form should be displayed and adds the controls to the form. Me.ClientSize = New System.Drawing.Size(292, 266) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.LinkLabel1}) Me.Text = "Link Label Example" End Sub Private Sub linkLabel1_LinkClicked(ByVal sender As Object, _ ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked ' Determine which link was clicked within the LinkLabel. Me.LinkLabel1.Links(LinkLabel1.Links.IndexOf(e.Link)).Visited = True ' Displays the appropriate link based on the value of the LinkData property of the Link object. Dim target As String = CType(e.Link.LinkData, String) ' If the value looks like a URL, navigate to it. ' Otherwise, display it in a message box. If (Nothing <> target) And (target.StartsWith("www")) Then System.Diagnostics.Process.Start(target) Else MessageBox.Show(("Item clicked: " + target)) End If End Sub End Class
using System; using System.Drawing; using System.Windows.Forms; public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.LinkLabel linkLabel1; [STAThread] static void Main() { Application.Run(new Form1()); } public Form1() { // Create the LinkLabel. this.linkLabel1 = new System.Windows.Forms.LinkLabel(); // Configure the LinkLabel's size and location. Specify that the // size should be automatically determined by the content. this.linkLabel1.Location = new System.Drawing.Point(34, 56); this.linkLabel1.Size = new System.Drawing.Size(224, 16); this.linkLabel1.AutoSize = true; // Configure the appearance. // Set the DisabledLinkColor so that a disabled link will show up against the form's background. this.linkLabel1.DisabledLinkColor = System.Drawing.Color.Red; this.linkLabel1.VisitedLinkColor = System.Drawing.Color.Blue; this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; this.linkLabel1.LinkColor = System.Drawing.Color.Navy; this.linkLabel1.TabIndex = 0; this.linkLabel1.TabStop = true; // Add an event handler to do something when the links are clicked. this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); // Identify what the first Link is. this.linkLabel1.LinkArea = new System.Windows.Forms.LinkArea(0, 8); // Identify that the first link is visited already. this.linkLabel1.Links[0].Visited = true; // Set the Text property to a string. this.linkLabel1.Text = "Register Online. Visit Microsoft. Visit MSN."; // Create new links using the Add method of the LinkCollection class. // Underline the appropriate words in the LinkLabel's Text property. // The words 'Register', 'Microsoft', and 'MSN' will // all be underlined and behave as hyperlinks. // First check that the Text property is long enough to accommodate // the desired hyperlinked areas. If it's not, don't add hyperlinks. if(this.linkLabel1.Text.Length >= 45) { this.linkLabel1.Links[0].LinkData = "Register"; this.linkLabel1.Links.Add(24, 9, "www.microsoft.com"); this.linkLabel1.Links.Add(42, 3, "www.msn.com"); // The second link is disabled and will appear as red. this.linkLabel1.Links[1].Enabled = false; } // Set up how the form should be displayed and add the controls to the form. this.ClientSize = new System.Drawing.Size(292, 266); this.Controls.AddRange(new System.Windows.Forms.Control[] {this.linkLabel1}); this.Text = "Link Label Example"; } private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { // Determine which link was clicked within the LinkLabel. this.linkLabel1.Links[linkLabel1.Links.IndexOf(e.Link)].Visited = true; // Display the appropriate link based on the value of the // LinkData property of the Link object. string target = e.Link.LinkData as string; // If the value looks like a URL, navigate to it. // Otherwise, display it in a message box. if(null != target && target.StartsWith("www")) { System.Diagnostics.Process.Start(target); } else { MessageBox.Show("Item clicked: " + target); } } }
#using <System.dll> #using <System.Windows.Forms.dll> #using <System.Drawing.dll> using namespace System; using namespace System::Drawing; using namespace System::Windows::Forms; public ref class Form1: public System::Windows::Forms::Form { private: System::Windows::Forms::LinkLabel^ linkLabel1; public: Form1() { // Create the LinkLabel. this->linkLabel1 = gcnew System::Windows::Forms::LinkLabel; // Configure the LinkLabel's size and location. Specify that the // size should be automatically determined by the content. this->linkLabel1->Location = System::Drawing::Point( 34, 56 ); this->linkLabel1->Size = System::Drawing::Size( 224, 16 ); this->linkLabel1->AutoSize = true; // Configure the appearance. this->linkLabel1->DisabledLinkColor = System::Drawing::Color::Red; this->linkLabel1->VisitedLinkColor = System::Drawing::Color::Blue; this->linkLabel1->LinkBehavior = System::Windows::Forms::LinkBehavior::HoverUnderline; this->linkLabel1->LinkColor = System::Drawing::Color::Navy; this->linkLabel1->TabIndex = 0; this->linkLabel1->TabStop = true; // Add an event handler to do something when the links are clicked. this->linkLabel1->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler( this, &Form1::linkLabel1_LinkClicked ); // Identify what the first Link is. this->linkLabel1->LinkArea = System::Windows::Forms::LinkArea( 0, 8 ); // Identify that the first link is visited already. this->linkLabel1->Links[ 0 ]->Visited = true; // Set the Text property to a String*. this->linkLabel1->Text = "Register Online. Visit Microsoft. Visit MSN."; // Create new links using the Add method of the LinkCollection class. // Underline the appropriate words in the LinkLabel's Text property. // The words 'Register', 'Microsoft', and 'MSN' will // all be underlined and behave as hyperlinks. // First check that the Text property is long enough to accommodate // the desired hyperlinked areas. If it's not, don't add hyperlinks. if ( this->linkLabel1->Text->Length >= 45 ) { this->linkLabel1->Links[ 0 ]->LinkData = "Register"; this->linkLabel1->Links->Add( 24, 9, "www.microsoft.com" ); this->linkLabel1->Links->Add( 42, 3, "www.msn.com" ); this->linkLabel1->Links[ 1 ]->Enabled = false; } // Set up how the form should be displayed and add the controls to the form. this->ClientSize = System::Drawing::Size( 292, 266 ); array<System::Windows::Forms::Control^>^temp0 = {this->linkLabel1}; this->Controls->AddRange( temp0 ); this->Text = "Link Label Example"; } private: void linkLabel1_LinkClicked( Object^ /*sender*/, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e ) { // Determine which link was clicked within the LinkLabel. this->linkLabel1->Links[ linkLabel1->Links->IndexOf( e->Link ) ]->Visited = true; // Display the appropriate link based on the value of the // LinkData property of the Link Object*. String^ target = dynamic_cast<String^>(e->Link->LinkData); // If the value looks like a URL, navigate to it. // Otherwise, display it in a message box. if ( nullptr != target && target->StartsWith( "www" ) ) { System::Diagnostics::Process::Start( target ); } else { MessageBox::Show( "Item clicked: {0}", target ); } } }; [STAThread] int main() { Application::Run( gcnew Form1 ); }
import System.*; import System.Drawing.*; import System.Windows.Forms.*; public class Form1 extends System.Windows.Forms.Form { private System.Windows.Forms.LinkLabel linkLabel1; /** @attribute STAThread() */ public static void main(String[] args) { Application.Run(new Form1()); } //main public Form1() { // Create the LinkLabel. this.linkLabel1 = new System.Windows.Forms.LinkLabel(); // Configure the LinkLabel's size and location. Specify that the // size should be automatically determined by the content. this.linkLabel1.set_Location(new System.Drawing.Point(34, 56)); this.linkLabel1.set_Size(new System.Drawing.Size(224, 16)); this.linkLabel1.set_AutoSize(true); // Configure the appearance. // Set the DisabledLinkColor so that a disabled link will show up // against the form's background. this.linkLabel1.set_DisabledLinkColor(System.Drawing.Color.get_Red()); this.linkLabel1.set_VisitedLinkColor(System.Drawing.Color.get_Blue()); this.linkLabel1.set_LinkBehavior( System.Windows.Forms.LinkBehavior.HoverUnderline); this.linkLabel1.set_LinkColor(System.Drawing.Color.get_Navy()); this.linkLabel1.set_TabIndex(0); this.linkLabel1.set_TabStop(true); // Add an event handler to do something when the links are clicked. this.linkLabel1.add_LinkClicked(new System.Windows.Forms. LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked)); // Identify what the first Link is. this.linkLabel1.set_LinkArea(new System.Windows.Forms.LinkArea(0, 8)); // Identify that the first link is visited already. this.linkLabel1.get_Links().get_Item(0).set_Visited(true); // Set the Text property to a string. this.linkLabel1.set_Text("Register Online. Visit Microsoft." + " Visit MSN."); // Create new links using the Add method of the LinkCollection class. // Underline the appropriate words in the LinkLabel's Text property. // The words 'Register', 'Microsoft', and 'MSN' will // all be underlined and behave as hyperlinks. // First check that the Text property is long enough to accommodate // the desired hyperlinked areas. If it's not, don't add hyperlinks. if (this.linkLabel1.get_Text().get_Length() >= 45) { this.linkLabel1.get_Links().get_Item(0).set_LinkData("Register"); this.linkLabel1.get_Links().Add(24, 9, "www.microsoft.com"); this.linkLabel1.get_Links().Add(42, 3, "www.msn.com"); // The second link is disabled and will appear as red. this.linkLabel1.get_Links().get_Item(1).set_Enabled(false); } // Set up how the form should be displayed and add the controls to // the form. this.set_ClientSize(new System.Drawing.Size(292, 266)); this.get_Controls().AddRange(new System.Windows.Forms.Control[] { this.linkLabel1 }); this.set_Text("Link Label Example"); } //Form1 private void linkLabel1_LinkClicked(Object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { // Determine which link was clicked within the LinkLabel. this.linkLabel1.get_Links().get_Item(linkLabel1.get_Links(). IndexOf(e.get_Link())).set_Visited(true); // Display the appropriate link based on the value of the // LinkData property of the Link object. String target = (String)e.get_Link().get_LinkData(); // If the value looks like a URL, navigate to it. // Otherwise, display it in a message box. if (null != target && target.StartsWith("www")) { System.Diagnostics.Process.Start(target); } else { MessageBox.Show("Item clicked: " + target); } } //linkLabel1_LinkClicked } //Form1

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


LinkLabel プロパティ



名前 | 説明 | |
---|---|---|
![]() | System.Windows.Forms.IButtonControl.DialogResult | このメンバの説明については、IButtonControl.DialogResult のトピックを参照してください。 |

関連項目
LinkLabel クラスSystem.Windows.Forms 名前空間
Label クラス
LinkLabelLinkClickedEventArgs
LinkLabel.Link
LinkLabel.LinkCollection
ToolStripLabel
LinkLabel メソッド


名前 | 説明 | |
---|---|---|
![]() | AccessibilityNotifyClients | オーバーロードされます。 ユーザー補助クライアント アプリケーションに AccessibleEvents を通知します。 ( Control から継承されます。) |
![]() | CalcImageRenderBounds | コントロールの配置に基づいて、Label コントロール内に描画されるイメージのサイズと位置を決定します。 ( Label から継承されます。) |
![]() | CreateAccessibilityInstance | オーバーライドされます。 LinkLabel コントロールの新しいユーザー補助オブジェクトを作成します。 |
![]() | CreateControlsInstance | コントロールのコントロール コレクションの新しいインスタンスを作成します。 ( Control から継承されます。) |
![]() | CreateHandle | オーバーライドされます。 コントロールのハンドルを作成します。このメソッドは、.NET Framework によって呼び出されますが、実際には呼び出さないようにすることをお勧めします。継承クラスでこのメソッドをオーバーライドする場合は、常に base.createHandle を呼び出す必要があります。 |
![]() | DefWndProc | 指定したメッセージを既定のウィンドウ プロシージャに送信します。 ( Control から継承されます。) |
![]() | DestroyHandle | コントロールに関連付けられたハンドルを破棄します。 ( Control から継承されます。) |
![]() | Dispose | オーバーロードされます。 Label によって使用されているリソースを解放します。 ( Label から継承されます。) |
![]() | DrawImage | Image を指定した境界内に描画します。 ( Label から継承されます。) |
![]() | Finalize | Component がガベージ コレクションによってクリアされる前に、アンマネージ リソースを解放し、その他のクリーンアップ操作を実行します。 ( Component から継承されます。) |
![]() | GetAccessibilityObjectById | 指定した AccessibleObject を取得します。 ( Control から継承されます。) |
![]() | GetAutoSizeMode | AutoSize プロパティが有効なときのコントロールの動作を示す値を取得します。 ( Control から継承されます。) |
![]() | GetScaledBounds | コントロールのスケールが設定される境界を取得します。 ( Control から継承されます。) |
![]() | GetService | Component またはその Container で提供されるサービスを表すオブジェクトを返します。 ( Component から継承されます。) |
![]() | GetStyle | コントロールの指定したコントロール スタイル ビットの値を取得します。 ( Control から継承されます。) |
![]() | GetTopLevel | コントロールがトップレベル コントロールかどうかを判断します。 ( Control から継承されます。) |
![]() | InitLayout | コントロールが別のコンテナに追加された後、呼び出されます。 ( Control から継承されます。) |
![]() | InvokeGotFocus | 指定したコントロールの GotFocus イベントを発生させます。 ( Control から継承されます。) |
![]() | InvokeLostFocus | 指定したコントロールの LostFocus イベントを発生させます。 ( Control から継承されます。) |
![]() | InvokeOnClick | 指定したコントロールの Click イベントを発生させます。 ( Control から継承されます。) |
![]() | InvokePaint | 指定したコントロールの Paint イベントを発生させます。 ( Control から継承されます。) |
![]() | InvokePaintBackground | 指定したコントロールの PaintBackground イベントを発生させます。 ( Control から継承されます。) |
![]() | IsInputChar | 文字が、コントロールによって認識される入力文字かどうかを判断します。 ( Control から継承されます。) |
![]() | IsInputKey | 指定されているキーが、通常の入力キーであるか、またはプリプロセスを必要とする特殊なキーであるかを確認します。 ( Control から継承されます。) |
![]() | MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |
![]() | NotifyInvalidate | 無効化するコントロールの領域を指定して、Invalidated イベントを発生させます。 ( Control から継承されます。) |
![]() | OnAutoSizeChanged | オーバーライドされます。 AutoSizeChanged イベントを発生させます。 |
![]() | OnBackColorChanged | BackColorChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnBackgroundImageChanged | BackgroundImageChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnBackgroundImageLayoutChanged | BackgroundImageLayoutChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnBindingContextChanged | BindingContextChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnCausesValidationChanged | CausesValidationChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnChangeUICues | ChangeUICues イベントを発生させます。 ( Control から継承されます。) |
![]() | OnClick | Click イベントを発生させます。 ( Control から継承されます。) |
![]() | OnClientSizeChanged | ClientSizeChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnContextMenuChanged | ContextMenuChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnContextMenuStripChanged | ContextMenuStripChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnControlAdded | ControlAdded イベントを発生させます。 ( Control から継承されます。) |
![]() | OnControlRemoved | ControlRemoved イベントを発生させます。 ( Control から継承されます。) |
![]() | OnCreateControl | CreateControl イベントを発生させます。 ( Control から継承されます。) |
![]() | OnCursorChanged | CursorChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnDockChanged | DockChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnDoubleClick | DoubleClick イベントを発生させます。 ( Control から継承されます。) |
![]() | OnDragDrop | DragDrop イベントを発生させます。 ( Control から継承されます。) |
![]() | OnDragEnter | DragEnter イベントを発生させます。 ( Control から継承されます。) |
![]() | OnDragLeave | DragLeave イベントを発生させます。 ( Control から継承されます。) |
![]() | OnDragOver | DragOver イベントを発生させます。 ( Control から継承されます。) |
![]() | OnEnabledChanged | オーバーライドされます。 |
![]() | OnEnter | Enter イベントを発生させます。 ( Control から継承されます。) |
![]() | OnFontChanged | オーバーライドされます。 |
![]() | OnForeColorChanged | ForeColorChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnGiveFeedback | GiveFeedback イベントを発生させます。 ( Control から継承されます。) |
![]() | OnGotFocus | オーバーライドされます。 GotFocus イベントを発生させます。 |
![]() | OnHandleCreated | HandleCreated イベントを発生させます。 ( Control から継承されます。) |
![]() | OnHandleDestroyed | HandleDestroyed イベントを発生させます。 ( Label から継承されます。) |
![]() | OnHelpRequested | HelpRequested イベントを発生させます。 ( Control から継承されます。) |
![]() | OnImeModeChanged | ImeModeChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnInvalidated | Invalidated イベントを発生させます。 ( Control から継承されます。) |
![]() | OnKeyDown | オーバーライドされます。 OnKeyDown イベントを発生させます。 |
![]() | OnKeyPress | KeyPress イベントを発生させます。 ( Control から継承されます。) |
![]() | OnKeyUp | KeyUp イベントを発生させます。 ( Control から継承されます。) |
![]() | OnLayout | Layout イベントを発生させます。 ( Control から継承されます。) |
![]() | OnLeave | Leave イベントを発生させます。 ( Control から継承されます。) |
![]() | OnLinkClicked | LinkClicked イベントを発生させます。 |
![]() | OnLocationChanged | LocationChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnLostFocus | オーバーライドされます。 LostFocus イベントを発生させます。 |
![]() | OnMarginChanged | MarginChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnMouseCaptureChanged | MouseCaptureChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnMouseClick | MouseClick イベントを発生させます。 ( Control から継承されます。) |
![]() | OnMouseDoubleClick | MouseDoubleClick イベントを発生させます。 ( Control から継承されます。) |
![]() | OnMouseDown | オーバーライドされます。 OnMouseDown イベントを発生させます。 |
![]() | OnMouseEnter | ( Label から継承されます。) |
![]() | OnMouseHover | MouseHover イベントを発生させます。 ( Control から継承されます。) |
![]() | OnMouseLeave | オーバーライドされます。 OnMouseLeave イベントを発生させます。 |
![]() | OnMouseMove | オーバーライドされます。 OnMouseMove イベントを発生させます。 |
![]() | OnMouseUp | オーバーライドされます。 OnMouseUp イベントを発生させます。 |
![]() | OnMouseWheel | MouseWheel イベントを発生させます。 ( Control から継承されます。) |
![]() | OnMove | Move イベントを発生させます。 ( Control から継承されます。) |
![]() | OnNotifyMessage | コントロールに Windows メッセージを通知します。 ( Control から継承されます。) |
![]() | OnPaddingChanged | オーバーライドされます。 PaddingChanged イベントを発生させます。 |
![]() | OnPaint | オーバーライドされます。 OnPaint イベントを発生させます。 |
![]() | OnPaintBackground | オーバーライドされます。 |
![]() | OnParentBackColorChanged | コントロールのコンテナの BackColor プロパティ値が変更された場合に、BackColorChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnParentBackgroundImageChanged | コントロールのコンテナの BackgroundImage プロパティ値が変更された場合に、BackgroundImageChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnParentBindingContextChanged | コントロールのコンテナの BindingContext プロパティ値が変更された場合に、BindingContextChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnParentChanged | ( Label から継承されます。) |
![]() | OnParentCursorChanged | CursorChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnParentEnabledChanged | コントロールのコンテナの Enabled プロパティ値が変更された場合に、EnabledChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnParentFontChanged | コントロールのコンテナの Font プロパティ値が変更された場合に、FontChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnParentForeColorChanged | コントロールのコンテナの ForeColor プロパティ値が変更された場合に、ForeColorChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnParentRightToLeftChanged | コントロールのコンテナの RightToLeft プロパティ値が変更された場合に、RightToLeftChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnParentVisibleChanged | コントロールのコンテナの Visible プロパティ値が変更された場合に、VisibleChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnPreviewKeyDown | PreviewKeyDown イベントを発生させます。 ( Control から継承されます。) |
![]() | OnPrint | Paint イベントを発生させます。 ( Control から継承されます。) |
![]() | OnQueryContinueDrag | QueryContinueDrag イベントを発生させます。 ( Control から継承されます。) |
![]() | OnRegionChanged | RegionChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnResize | Resize イベントを発生させます。 ( Control から継承されます。) |
![]() | OnRightToLeftChanged | RightToLeftChanged イベントを発生させます。 ( Label から継承されます。) |
![]() | OnSizeChanged | SizeChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnStyleChanged | StyleChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnSystemColorsChanged | SystemColorsChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnTabIndexChanged | TabIndexChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnTabStopChanged | TabStopChanged イベントを発生させます。 ( Control から継承されます。) |
![]() | OnTextAlignChanged | オーバーライドされます。 |
![]() | OnTextChanged | オーバーライドされます。 |
![]() | OnValidated | Validated イベントを発生させます。 ( Control から継承されます。) |
![]() | OnValidating | Validating イベントを発生させます。 ( Control から継承されます。) |
![]() | OnVisibleChanged | ( Label から継承されます。) |
![]() | PointInLink | 指定されたクライアント座標にあるリンクを取得します。 |
![]() | ProcessCmdKey | コマンド キーを処理します。 ( Control から継承されます。) |
![]() | ProcessDialogChar | ダイアログ文字を処理します。 ( Control から継承されます。) |
![]() | ProcessDialogKey | オーバーライドされます。 ダイアログ キーを処理します。 |
![]() | ProcessKeyEventArgs | キー メッセージを処理し、適切なコントロール イベントを生成します。 ( Control から継承されます。) |
![]() | ProcessKeyMessage | キーボード メッセージを処理します。 ( Control から継承されます。) |
![]() | ProcessKeyPreview | キーボード メッセージをプレビューします。 ( Control から継承されます。) |
![]() | ProcessMnemonic | ( Label から継承されます。) |
![]() | RaiseDragEvent | 適切なドラッグ イベントを発生させます。 ( Control から継承されます。) |
![]() | RaiseKeyEvent | 適切なキー イベントを発生させます。 ( Control から継承されます。) |
![]() | RaiseMouseEvent | 適切なマウス イベントを発生させます。 ( Control から継承されます。) |
![]() | RaisePaintEvent | 適切な描画イベントを発生させます。 ( Control から継承されます。) |
![]() | RecreateHandle | 強制的にコントロールのハンドルを再作成します。 ( Control から継承されます。) |
![]() | ReflectMessage | 指定したメッセージを指定したハンドルにバインドされたコントロールにリフレクションします。 ( Control から継承されます。) |
![]() | ResetMouseEventArgs | MouseLeave イベントを処理するためのコントロールをリセットします。 ( Control から継承されます。) |
![]() | RtlTranslateAlignment | オーバーロードされます。 現在の配置を適切な配置に変換し、テキストを右から左に表示できるようにします。 ( Control から継承されます。) |
![]() | RtlTranslateContent | 指定した ContentAlignment を適切な ContentAlignment に変換し、テキストを右から左に表示できるようにします。 ( Control から継承されます。) |
![]() | RtlTranslateHorizontal | 指定した HorizontalAlignment を適切な HorizontalAlignment に変換し、テキストを右から左に表示できるようにします。 ( Control から継承されます。) |
![]() | RtlTranslateLeftRight | 指定した LeftRightAlignment を適切な LeftRightAlignment に変換し、テキストを右から左に表示できるようにします。 ( Control から継承されます。) |
![]() | ScaleControl | コントロールの位置、サイズ、埋め込み、およびマージンのスケールを設定します。 ( Control から継承されます。) |
![]() | ScaleCore | ( Control から継承されます。) |
![]() | Select | オーバーロードされます。 オーバーライドされます。 |
![]() | SetAutoSizeMode | AutoSize プロパティが有効なときのコントロールの動作を示す値を設定します。 ( Control から継承されます。) |
![]() | SetBoundsCore | オーバーライドされます。 このコントロールの境界を設定する作業を実行します。 |
![]() | SetClientSizeCore | コントロールのクライアント領域のサイズを設定します。 ( Control から継承されます。) |
![]() | SetStyle | 指定したスタイル ビットを指定した値に設定します。 ( Control から継承されます。) |
![]() | SetTopLevel | コントロールをトップレベル コントロールとして設定します。 ( Control から継承されます。) |
![]() | SetVisibleCore | コントロールを指定した表示状態に設定します。 ( Control から継承されます。) |
![]() | SizeFromClientSize | クライアント領域の高さおよび幅からコントロール全体のサイズを決定します。 ( Control から継承されます。) |
![]() | UpdateBounds | オーバーロードされます。 コントロールの範囲を更新します。 ( Control から継承されます。) |
![]() | UpdateStyles | 割り当て済みのスタイルを強制的にコントロールに再適用します。 ( Control から継承されます。) |
![]() | UpdateZOrder | コントロールを親の z オーダーで更新します。 ( Control から継承されます。) |
![]() | WndProc | オーバーライドされます。 |

名前 | 説明 | |
---|---|---|
![]() | System.Windows.Forms.IButtonControl.NotifyDefault | LinkLabel コントロールに、それが既定のボタンであるということが通知されます。 |
![]() | System.Windows.Forms.IButtonControl.PerformClick | LinkLabel コントロールの Click イベントを生成します。 |

関連項目
LinkLabel クラスSystem.Windows.Forms 名前空間
Label クラス
LinkLabelLinkClickedEventArgs
LinkLabel.Link
LinkLabel.LinkCollection
ToolStripLabel
LinkLabel メンバ
ハイパーリンクを表示できる Windows ラベル コントロールを表します。
LinkLabel データ型で公開されるメンバを以下の表に示します。





名前 | 説明 | |
---|---|---|
![]() | AccessibilityNotifyClients | オーバーロードされます。 ユーザー補助クライアント アプリケーションに AccessibleEvents を通知します。 (Control から継承されます。) |
![]() | CalcImageRenderBounds | コントロールの配置に基づいて、Label コントロール内に描画されるイメージのサイズと位置を決定します。 (Label から継承されます。) |
![]() | CreateAccessibilityInstance | オーバーライドされます。 LinkLabel コントロールの新しいユーザー補助オブジェクトを作成します。 |
![]() | CreateControlsInstance | コントロールのコントロール コレクションの新しいインスタンスを作成します。 (Control から継承されます。) |
![]() | CreateHandle | オーバーライドされます。 コントロールのハンドルを作成します。このメソッドは、.NET Framework によって呼び出されますが、実際には呼び出さないようにすることをお勧めします。継承クラスでこのメソッドをオーバーライドする場合は、常に base.createHandle を呼び出す必要があります。 |
![]() | DefWndProc | 指定したメッセージを既定のウィンドウ プロシージャに送信します。 (Control から継承されます。) |
![]() | DestroyHandle | コントロールに関連付けられたハンドルを破棄します。 (Control から継承されます。) |
![]() | Dispose | オーバーロードされます。 Label によって使用されているリソースを解放します。 (Label から継承されます。) |
![]() | DrawImage | Image を指定した境界内に描画します。 (Label から継承されます。) |
![]() | Finalize | Component がガベージ コレクションによってクリアされる前に、アンマネージ リソースを解放し、その他のクリーンアップ操作を実行します。 (Component から継承されます。) |
![]() | GetAccessibilityObjectById | 指定した AccessibleObject を取得します。 (Control から継承されます。) |
![]() | GetAutoSizeMode | AutoSize プロパティが有効なときのコントロールの動作を示す値を取得します。 (Control から継承されます。) |
![]() | GetScaledBounds | コントロールのスケールが設定される境界を取得します。 (Control から継承されます。) |
![]() | GetService | Component またはその Container で提供されるサービスを表すオブジェクトを返します。 (Component から継承されます。) |
![]() | GetStyle | コントロールの指定したコントロール スタイル ビットの値を取得します。 (Control から継承されます。) |
![]() | GetTopLevel | コントロールがトップレベル コントロールかどうかを判断します。 (Control から継承されます。) |
![]() | InitLayout | コントロールが別のコンテナに追加された後、呼び出されます。 (Control から継承されます。) |
![]() | InvokeGotFocus | 指定したコントロールの GotFocus イベントを発生させます。 (Control から継承されます。) |
![]() | InvokeLostFocus | 指定したコントロールの LostFocus イベントを発生させます。 (Control から継承されます。) |
![]() | InvokeOnClick | 指定したコントロールの Click イベントを発生させます。 (Control から継承されます。) |
![]() | InvokePaint | 指定したコントロールの Paint イベントを発生させます。 (Control から継承されます。) |
![]() | InvokePaintBackground | 指定したコントロールの PaintBackground イベントを発生させます。 (Control から継承されます。) |
![]() | IsInputChar | 文字が、コントロールによって認識される入力文字かどうかを判断します。 (Control から継承されます。) |
![]() | IsInputKey | 指定されているキーが、通常の入力キーであるか、またはプリプロセスを必要とする特殊なキーであるかを確認します。 (Control から継承されます。) |
![]() | MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |
![]() | NotifyInvalidate | 無効化するコントロールの領域を指定して、Invalidated イベントを発生させます。 (Control から継承されます。) |
![]() | OnAutoSizeChanged | オーバーライドされます。 AutoSizeChanged イベントを発生させます。 |
![]() | OnBackColorChanged | BackColorChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnBackgroundImageChanged | BackgroundImageChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnBackgroundImageLayoutChanged | BackgroundImageLayoutChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnBindingContextChanged | BindingContextChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnCausesValidationChanged | CausesValidationChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnChangeUICues | ChangeUICues イベントを発生させます。 (Control から継承されます。) |
![]() | OnClick | Click イベントを発生させます。 (Control から継承されます。) |
![]() | OnClientSizeChanged | ClientSizeChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnContextMenuChanged | ContextMenuChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnContextMenuStripChanged | ContextMenuStripChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnControlAdded | ControlAdded イベントを発生させます。 (Control から継承されます。) |
![]() | OnControlRemoved | ControlRemoved イベントを発生させます。 (Control から継承されます。) |
![]() | OnCreateControl | CreateControl イベントを発生させます。 (Control から継承されます。) |
![]() | OnCursorChanged | CursorChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnDockChanged | DockChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnDoubleClick | DoubleClick イベントを発生させます。 (Control から継承されます。) |
![]() | OnDragDrop | DragDrop イベントを発生させます。 (Control から継承されます。) |
![]() | OnDragEnter | DragEnter イベントを発生させます。 (Control から継承されます。) |
![]() | OnDragLeave | DragLeave イベントを発生させます。 (Control から継承されます。) |
![]() | OnDragOver | DragOver イベントを発生させます。 (Control から継承されます。) |
![]() | OnEnabledChanged | オーバーライドされます。 |
![]() | OnEnter | Enter イベントを発生させます。 (Control から継承されます。) |
![]() | OnFontChanged | オーバーライドされます。 |
![]() | OnForeColorChanged | ForeColorChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnGiveFeedback | GiveFeedback イベントを発生させます。 (Control から継承されます。) |
![]() | OnGotFocus | オーバーライドされます。 GotFocus イベントを発生させます。 |
![]() | OnHandleCreated | HandleCreated イベントを発生させます。 (Control から継承されます。) |
![]() | OnHandleDestroyed | HandleDestroyed イベントを発生させます。 (Label から継承されます。) |
![]() | OnHelpRequested | HelpRequested イベントを発生させます。 (Control から継承されます。) |
![]() | OnImeModeChanged | ImeModeChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnInvalidated | Invalidated イベントを発生させます。 (Control から継承されます。) |
![]() | OnKeyDown | オーバーライドされます。 OnKeyDown イベントを発生させます。 |
![]() | OnKeyPress | KeyPress イベントを発生させます。 (Control から継承されます。) |
![]() | OnKeyUp | KeyUp イベントを発生させます。 (Control から継承されます。) |
![]() | OnLayout | Layout イベントを発生させます。 (Control から継承されます。) |
![]() | OnLeave | Leave イベントを発生させます。 (Control から継承されます。) |
![]() | OnLinkClicked | LinkClicked イベントを発生させます。 |
![]() | OnLocationChanged | LocationChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnLostFocus | オーバーライドされます。 LostFocus イベントを発生させます。 |
![]() | OnMarginChanged | MarginChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnMouseCaptureChanged | MouseCaptureChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnMouseClick | MouseClick イベントを発生させます。 (Control から継承されます。) |
![]() | OnMouseDoubleClick | MouseDoubleClick イベントを発生させます。 (Control から継承されます。) |
![]() | OnMouseDown | オーバーライドされます。 OnMouseDown イベントを発生させます。 |
![]() | OnMouseEnter | ( Label から継承されます。) |
![]() | OnMouseHover | MouseHover イベントを発生させます。 (Control から継承されます。) |
![]() | OnMouseLeave | オーバーライドされます。 OnMouseLeave イベントを発生させます。 |
![]() | OnMouseMove | オーバーライドされます。 OnMouseMove イベントを発生させます。 |
![]() | OnMouseUp | オーバーライドされます。 OnMouseUp イベントを発生させます。 |
![]() | OnMouseWheel | MouseWheel イベントを発生させます。 (Control から継承されます。) |
![]() | OnMove | Move イベントを発生させます。 (Control から継承されます。) |
![]() | OnNotifyMessage | コントロールに Windows メッセージを通知します。 (Control から継承されます。) |
![]() | OnPaddingChanged | オーバーライドされます。 PaddingChanged イベントを発生させます。 |
![]() | OnPaint | オーバーライドされます。 OnPaint イベントを発生させます。 |
![]() | OnPaintBackground | オーバーライドされます。 |
![]() | OnParentBackColorChanged | コントロールのコンテナの BackColor プロパティ値が変更された場合に、BackColorChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnParentBackgroundImageChanged | コントロールのコンテナの BackgroundImage プロパティ値が変更された場合に、BackgroundImageChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnParentBindingContextChanged | コントロールのコンテナの BindingContext プロパティ値が変更された場合に、BindingContextChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnParentChanged | ( Label から継承されます。) |
![]() | OnParentCursorChanged | CursorChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnParentEnabledChanged | コントロールのコンテナの Enabled プロパティ値が変更された場合に、EnabledChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnParentFontChanged | コントロールのコンテナの Font プロパティ値が変更された場合に、FontChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnParentForeColorChanged | コントロールのコンテナの ForeColor プロパティ値が変更された場合に、ForeColorChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnParentRightToLeftChanged | コントロールのコンテナの RightToLeft プロパティ値が変更された場合に、RightToLeftChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnParentVisibleChanged | コントロールのコンテナの Visible プロパティ値が変更された場合に、VisibleChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnPreviewKeyDown | PreviewKeyDown イベントを発生させます。 (Control から継承されます。) |
![]() | OnPrint | Paint イベントを発生させます。 (Control から継承されます。) |
![]() | OnQueryContinueDrag | QueryContinueDrag イベントを発生させます。 (Control から継承されます。) |
![]() | OnRegionChanged | RegionChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnResize | Resize イベントを発生させます。 (Control から継承されます。) |
![]() | OnRightToLeftChanged | RightToLeftChanged イベントを発生させます。 (Label から継承されます。) |
![]() | OnSizeChanged | SizeChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnStyleChanged | StyleChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnSystemColorsChanged | SystemColorsChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnTabIndexChanged | TabIndexChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnTabStopChanged | TabStopChanged イベントを発生させます。 (Control から継承されます。) |
![]() | OnTextAlignChanged | オーバーライドされます。 |
![]() | OnTextChanged | オーバーライドされます。 |
![]() | OnValidated | Validated イベントを発生させます。 (Control から継承されます。) |
![]() | OnValidating | Validating イベントを発生させます。 (Control から継承されます。) |
![]() | OnVisibleChanged | ( Label から継承されます。) |
![]() | PointInLink | 指定されたクライアント座標にあるリンクを取得します。 |
![]() | ProcessCmdKey | コマンド キーを処理します。 (Control から継承されます。) |
![]() | ProcessDialogChar | ダイアログ文字を処理します。 (Control から継承されます。) |
![]() | ProcessDialogKey | オーバーライドされます。 ダイアログ キーを処理します。 |
![]() | ProcessKeyEventArgs | キー メッセージを処理し、適切なコントロール イベントを生成します。 (Control から継承されます。) |
![]() | ProcessKeyMessage | キーボード メッセージを処理します。 (Control から継承されます。) |
![]() | ProcessKeyPreview | キーボード メッセージをプレビューします。 (Control から継承されます。) |
![]() | ProcessMnemonic | ( Label から継承されます。) |
![]() | RaiseDragEvent | 適切なドラッグ イベントを発生させます。 (Control から継承されます。) |
![]() | RaiseKeyEvent | 適切なキー イベントを発生させます。 (Control から継承されます。) |
![]() | RaiseMouseEvent | 適切なマウス イベントを発生させます。 (Control から継承されます。) |
![]() | RaisePaintEvent | 適切な描画イベントを発生させます。 (Control から継承されます。) |
![]() | RecreateHandle | 強制的にコントロールのハンドルを再作成します。 (Control から継承されます。) |
![]() | ReflectMessage | 指定したメッセージを指定したハンドルにバインドされたコントロールにリフレクションします。 (Control から継承されます。) |
![]() | ResetMouseEventArgs | MouseLeave イベントを処理するためのコントロールをリセットします。 (Control から継承されます。) |
![]() | RtlTranslateAlignment | オーバーロードされます。 現在の配置を適切な配置に変換し、テキストを右から左に表示できるようにします。 (Control から継承されます。) |
![]() | RtlTranslateContent | 指定した ContentAlignment を適切な ContentAlignment に変換し、テキストを右から左に表示できるようにします。 (Control から継承されます。) |
![]() | RtlTranslateHorizontal | 指定した HorizontalAlignment を適切な HorizontalAlignment に変換し、テキストを右から左に表示できるようにします。 (Control から継承されます。) |
![]() | RtlTranslateLeftRight | 指定した LeftRightAlignment を適切な LeftRightAlignment に変換し、テキストを右から左に表示できるようにします。 (Control から継承されます。) |
![]() | ScaleControl | コントロールの位置、サイズ、埋め込み、およびマージンのスケールを設定します。 (Control から継承されます。) |
![]() | ScaleCore | ( Control から継承されます。) |
![]() | Select | オーバーロードされます。 オーバーライドされます。 |
![]() | SetAutoSizeMode | AutoSize プロパティが有効なときのコントロールの動作を示す値を設定します。 (Control から継承されます。) |
![]() | SetBoundsCore | オーバーライドされます。 このコントロールの境界を設定する作業を実行します。 |
![]() | SetClientSizeCore | コントロールのクライアント領域のサイズを設定します。 (Control から継承されます。) |
![]() | SetStyle | 指定したスタイル ビットを指定した値に設定します。 (Control から継承されます。) |
![]() | SetTopLevel | コントロールをトップレベル コントロールとして設定します。 (Control から継承されます。) |
![]() | SetVisibleCore | コントロールを指定した表示状態に設定します。 (Control から継承されます。) |
![]() | SizeFromClientSize | クライアント領域の高さおよび幅からコントロール全体のサイズを決定します。 (Control から継承されます。) |
![]() | UpdateBounds | オーバーロードされます。 コントロールの範囲を更新します。 (Control から継承されます。) |
![]() | UpdateStyles | 割り当て済みのスタイルを強制的にコントロールに再適用します。 (Control から継承されます。) |
![]() | UpdateZOrder | コントロールを親の z オーダーで更新します。 (Control から継承されます。) |
![]() | WndProc | オーバーライドされます。 |


名前 | 説明 | |
---|---|---|
![]() | System.Windows.Forms.IButtonControl.NotifyDefault | LinkLabel コントロールに、それが既定のボタンであるということが通知されます。 |
![]() | System.Windows.Forms.IButtonControl.PerformClick | LinkLabel コントロールの Click イベントを生成します。 |
![]() | System.Windows.Forms.IButtonControl.DialogResult | このメンバの説明については、IButtonControl.DialogResult のトピックを参照してください。 |

関連項目
LinkLabel クラスSystem.Windows.Forms 名前空間
Label クラス
LinkLabelLinkClickedEventArgs
LinkLabel.Link
LinkLabel.LinkCollection
ToolStripLabel
- LinkLabelのページへのリンク