?? contactinfocontrol.cs
字號:
?namespace Imps.Client.Pc
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
public class ContactInfoControl : UserControl
{
private Color _BorderColor = Color.FromArgb(0xa4, 170, 220);
private string _fetionNo;
private System.Drawing.Image _image;
private int _imageHeight = 0x60;
private int _imagePadding = 8;
private int _imageWidth = 0x60;
private string _mobileNo;
private Rectangle _recPicture;
private string _toolTipText;
private IContainer components;
private TextBox txtFetionNo;
private TextBox txtMobileNo;
public event EventHandler<MouseEventArgs> PictureMouseClick;
public ContactInfoControl()
{
this.InitializeComponent();
base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true);
this.BackColor = Color.White;
this.MobileNo = string.Empty;
this.FetionNo = string.Empty;
base.MouseMove += new MouseEventHandler(this.ContactInfoControl_MouseMove);
base.MouseClick += new MouseEventHandler(this.ContactInfoControl_MouseClick);
}
private void ContactInfoControl_MouseClick(object sender, MouseEventArgs e)
{
if ((this.PictureMouseClick != null) && this._recPicture.Contains(e.Location))
{
this.PictureMouseClick(sender, e);
}
}
private void ContactInfoControl_MouseMove(object sender, MouseEventArgs e)
{
if (this._recPicture.Contains(e.Location))
{
this.Cursor = Cursors.Hand;
}
else
{
this.Cursor = Cursors.Default;
}
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.txtMobileNo = new TextBox();
this.txtFetionNo = new TextBox();
base.SuspendLayout();
this.txtMobileNo.BackColor = Color.White;
this.txtMobileNo.BorderStyle = BorderStyle.None;
this.txtMobileNo.ForeColor = Color.Gray;
this.txtMobileNo.Location = new Point(7, 0x75);
this.txtMobileNo.Name = "txtMobileNo";
this.txtMobileNo.ReadOnly = true;
this.txtMobileNo.Size = new Size(110, 13);
this.txtMobileNo.TabIndex = 2;
this.txtMobileNo.Text = "手機號:13810261800";
this.txtFetionNo.BackColor = Color.White;
this.txtFetionNo.BorderStyle = BorderStyle.None;
this.txtFetionNo.ForeColor = Color.Gray;
this.txtFetionNo.Location = new Point(7, 0x88);
this.txtFetionNo.Name = "txtFetionNo";
this.txtFetionNo.ReadOnly = true;
this.txtFetionNo.Size = new Size(110, 13);
this.txtFetionNo.TabIndex = 2;
this.txtFetionNo.Text = "飛信號:123456789";
base.AutoScaleDimensions = new SizeF(6f, 13f);
base.AutoScaleMode = AutoScaleMode.Font;
this.BackColor = Color.Transparent;
base.Controls.Add(this.txtFetionNo);
base.Controls.Add(this.txtMobileNo);
base.Name = "ContactInfoControl";
base.Size = new Size(0x76, 0x9c);
base.ResumeLayout(false);
base.PerformLayout();
}
protected override void OnPaint(PaintEventArgs e)
{
using (Pen pen = new Pen(this._BorderColor))
{
e.Graphics.DrawRectangle(pen, 0, 0, base.Width - 1, base.Height - 1);
this._recPicture = new Rectangle(this._imagePadding, this._imagePadding, this._imageWidth + 6, this._imageHeight + 6);
e.Graphics.DrawRectangle(pen, this._recPicture);
}
if (this._image != null)
{
e.Graphics.DrawImage(this._image, this._imagePadding + 3, this._imagePadding + 3, this._imageWidth, this._imageHeight);
}
}
public Color BorderColor
{
get
{
return this._BorderColor;
}
set
{
this._BorderColor = value;
}
}
public string FetionNo
{
get
{
return this._fetionNo;
}
set
{
this._fetionNo = value;
this.txtFetionNo.Text = "飛信號:" + this._fetionNo;
}
}
public System.Drawing.Image Image
{
get
{
return this._image;
}
set
{
this._image = value;
base.Invalidate();
}
}
public string MobileNo
{
get
{
return this._mobileNo;
}
set
{
this._mobileNo = value;
this.txtMobileNo.Text = "手機號:" + this._mobileNo;
}
}
public string ToolTipText
{
get
{
return this._toolTipText;
}
set
{
this._toolTipText = value;
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -