blog.visualp.com
[원문] : http://www.csharphelp.com/2006/06/an-overview-of-link-label-in-c/
Introduction:
The LinkLabel control exhibits links to otherobjects, such as files or Web pages. Class LinkLabel is derived fromclass Label and therefore inherits all of class Label�s functionality.A LinkLabel looks as underlined text. When the mouse moves above thelink, the pointer modify to a hand. This is alike to the behavior of ahyperlink in a Web page. The link can change color to indicate whetherthe link is new, visited or active. When clicked, the LinkLabelgenerates a LinkClicked event.
Class LinkLabel :
Class LinkLabel is derived from class Label and therefore inherits all ofclass Label�s functionality. Hand image displays when mouse moves over LinkLabel.
Some common Properties of LinkLabel:
ActiveLinkColor – Denotes the color of the active link when clicked. Default is red.LinkColor – Denotes the original color of every links prior to they have been visited. Default is blue.
Links – Lists the LinkLabel Link objects, which are the links enclosed in the LinkLabel.
LinkVisited – If True, link appears as though it were visited (itscolor is changed to that specified by property VisitedLinkColor).
Text – Denotes the text to show on the control.
VisitedLinkColor – Denotes the color of visited links. Default is purple.
LinkArea – Denotes which part of text in the LinkLabel is treated as element of the link.
LinkBehavior – Denotes the link�s behavior, for example how the link come into view when the mouse is positioned over it.
LinkClicked – Generated when link is clicked.
Now let us see the usage of LinkLabel control with an example:
In this example I place a LinkLabel control with the text "To know C# -visit www.csharpheaven.com – Click Here!" and provide a link to aportion of the text. So that when clicked, the LinkLabel generates aLinkClicked event.
The Example:
using System;
using System.Drawing;
using System.ComponentModel;
using System.WinForms;
public class LinkLabel : System.WinForms.Form {
private System.WinForms.LinkLabel linkLabel1;
public LinkLabel() {
InitializeComponent();
}
public override void Dispose() {
base.Dispose();
}
public static void Main(string[] args) {
Application.Run(new LinkLabel());}
private void InitializeComponent()
{
this.linkLabel1 = new System.WinForms.LinkLabel();
linkLabel1.Text = "To know C# – visit www.csharpheaven.com – Click Here!";
linkLabel1.Size = new System.Drawing.Size(168, 56);
linkLabel1.LinkColor =
(System.Drawing.Color)System.Drawing.Color.FromARGB((byte)128,(byte)255, (byte)255);
linkLabel1.LinkArea = new System.Drawing.Point(42, 11);
linkLabel1.ForeColor = System.Drawing.Color.Maroon;
linkLabel1.Font = new System.Drawing.Font("Times New Roman", 10f,
System.Drawing.FontStyle.Bold);
linkLabel1.TabIndex = 0;
linkLabel1.TabStop = true;
linkLabel1.Location = new System.Drawing.Point(8, 16);
linkLabel1.LinkClick += new System.EventHandler(linkLabel1_LinkClicked);
this.Controls.Add(linkLabel1);
this.BackColor =
(System.Drawing.Color)System.Drawing.Color.FromARGB((byte)255, (byte)128, (byte)128);
}
protected void linkLabel1_LinkClicked(object sender, System.EventArgs e)
{
System.Diagnostics.Process.Start("IExplore"," http://www.csharphelp.com");
}
}
Here the above program is written by hand (Adding LinkLabelcontrol to a form programmatically)
The program below is the code generated by the WINDES.exe.
// Win32Form1.cs
namespace Win32Form1Namespace {
using System;
using System.Drawing;
using System.ComponentModel;
using System.WinForms;
/// <summary>
/// Summary description for Win32Form1.
/// </summary>
public class Win32Form1 : System.WinForms.Form {
/// <summary>
/// Required by the Win Forms designer
/// </summary>
private System.ComponentModel.Container components;
private System.WinForms.LinkLabel linkLabel1;
public Win32Form1() {
// Required for Win Form Designer support
InitializeComponent();
// TODO: Add any constructor code after InitializeComponent call
}
/// <summary>
/// Clean up any resources being used
/// </summary>
public override void Dispose() {
base.Dispose();
components.Dispose();
}
/// <summary>
/// The main entry point for the application.
/// </summary>
public static void Main(string[] args) {
Application.Run(new Win32Form1());
}
/// <summary>
/// Required method for Designer support – do not modify
/// the contents of this method with an editor
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.linkLabel1 = new System.WinForms.LinkLabel();
//@design this.TrayHeight = 0;
//@design this.TrayLargeIcon = false;
//@design this.TrayAutoArrange = true;
linkLabel1.Text = "To know C# – visit www.csharpheaven.com – Click Here!";
linkLabel1.Size = new System.Drawing.Size(184, 56);
linkLabel1.LinkColor = System.Drawing.Color.Teal;
linkLabel1.LinkArea = new System.Drawing.Point(42, 11);
linkLabel1.ForeColor = System.Drawing.Color.Maroon;
linkLabel1.Font =
new System.Drawing.Font("Times New Roman", 10f, System.Drawing.FontStyle.Bold);
linkLabel1.TabIndex = 0;
linkLabel1.DisabledLinkColor = System.Drawing.Color.Yellow;
linkLabel1.TabStop = true;
linkLabel1.Location = new System.Drawing.Point(8, 16);
linkLabel1.BackColor =
(System.Drawing.Color)System.Drawing.Color.FromARGB((byte)255, (byte)192, (byte)128);
linkLabel1.LinkClick += new System.EventHandler(linkLabel1_LinkClick);
this.Text = "Win32Form1";
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.KeyPreview = true;
this.TransparencyKey = System.Drawing.Color.White;
this.BackColor =
(System.Drawing.Color)System.Drawing.Color.FromARGB((byte)255, (byte)128, (byte)128);
this.ClientSize = new System.Drawing.Size(272, 149);
this.Click += new System.EventHandler(Win32Form1_Click);
this.Controls.Add(linkLabel1);
}
protected void Win32Form1_Click(object sender, System.EventArgs e)
{
}
protected void linkLabel1_LinkClick(object sender, System.EventArgs e)
{
System.Diagnostics.Process.Start("IExplore", "http://www.csharphelp.com" );
linkLabel1.LinkVisited = true;
}
}
}
using System;
using System.Windows.Forms;
using System.Drawing;
class TimerDemo:Form
{
Timer Clock;
Label lbTime=new Label();
public TimerDemo()
{
Clock=new Timer();
Clock.Interval=1000;
Clock.Start();
Clock.Tick+=new EventHandler(Timer_Tick);
this.Controls.Add(lbTime);
lbTime.BackColor=Color.Black;
lbTime.ForeColor=Color.Red;
lbTime.Font=new Font("Times New Roman",15);
lbTime.Text=GetTime();
}
public string GetTime()
{
string TimeInString="";
int hour=DateTime.Now.Hour;
int min=DateTime.Now.Minute;
int sec=DateTime.Now.Second;
TimeInString=(hour < 10)?"0" + hour.ToString() :hour.ToString();
TimeInString+=":" + ((min<10)?"0" + min.ToString() :min.ToString());
TimeInString+=":" + ((sec<10)?"0" + sec.ToString() :sec.ToString());
return TimeInString;
}
public void Timer_Tick(object sender,EventArgs eArgs)
{
if(sender==Clock)
{
lbTime.Text=GetTime();
}
}
public static void Main()
{
Application.Run(new TimerDemo());
}
}
c# application 용 셈플 에디터
http://windowsclient.net/downloads/folders/controlgallery/entry1460.aspx
응용 하면 웹 에디터 가능
[출처] [C#] DateTime 클래스 활용|작성자 니나다
[원문] http://ssis.wik.is/Understanding_Connectivity_Stacks/ADO.NET_vs_OLEDB
OLE DB가 ADO보다 빠르다? ... 딜레마에 빠지는 ...........
An often asked aspect of SSIS is which data source/destination provider to use when connecting to various databases and data sources. In my previous articles, I explained what these connectivity libraries are and how SQL Server Integration Services supports them across the product.
In this article, I will try to provide guidance for when to choose various connectivity options when building SSIS packages. To better structure the pros and cons of using either ADO.NET or OLEDB, I will outline my arguments in terms of product-wide support, performance, 64-bit considerations, and target data source version and type-system supportability.
ADO.NET vs OLEDB : SSIS support across the product
ADO.NET vs OLEDB : Performance
ADO.NET vs OLEDB : 64bit considerations
ADO.NET vs OLEDB : Target data source & data type supportability
We also have a white paper on connectivity which covers other aspects of this subjst, it’s a good read: Connectivity_White_Paper
Deniz Erkan - msft