消息框:

using System.Runtime.InteropServices;

namespace Windows_API_实现屏幕右下角_消息框_
{
public partial class Msg : Form
{
public Msg()
{
InitializeComponent();
Point p = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width - , Screen.PrimaryScreen.WorkingArea.Height - this.Height - );
this.PointToScreen(p);
this.Location = p;
} [DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_MOVE = 0xF010;
public const int HTCAPTION = 0x0002; private void FrmLogin_MouseDown(object sender, MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, );
} private Thread td;
delegate void SetTextCallBack(string txt);
private void Msg_Load(object sender, EventArgs e)
{
OnLoad();
}
private void SetText(string txt)
{
if (string.IsNullOrEmpty(txt))
return;
string first = txt.Substring(, );
string second = txt.Substring(, txt.Length - );
string thrid = second + first;
if (lblMsg.InvokeRequired)
{
SetTextCallBack cb = new SetTextCallBack(SetText);
BeginInvoke(cb, thrid);
}
else
lblMsg.Text = thrid;
} private void Msg_FormClosing(object sender, FormClosingEventArgs e)
{
td.Abort();
} internal void OnLoad()
{
td = new Thread(() =>
{
while (true)
{
SetText(lblMsg.Text);
Thread.Sleep();
}
});
td.Start();
} private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
namespace Windows_API_实现屏幕右下角_消息框_
{
partial class Msg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #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>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Msg));
this.lblMsg = new System.Windows.Forms.Label();
this.btnClose = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lblMsg
//
this.lblMsg.BackColor = System.Drawing.Color.Transparent;
this.lblMsg.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)()));
this.lblMsg.ForeColor = System.Drawing.Color.DarkGreen;
this.lblMsg.Location = new System.Drawing.Point(, );
this.lblMsg.Name = "lblMsg";
this.lblMsg.Size = new System.Drawing.Size(, );
this.lblMsg.TabIndex = ;
this.lblMsg.Text = "Hello~ WinAPI 实现屏幕右下角“消息框” ";
this.lblMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnClose
//
this.btnClose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnClose.BackgroundImage")));
this.btnClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnClose.Location = new System.Drawing.Point(, );
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(, );
this.btnClose.TabIndex = ;
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// Msg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.ClientSize = new System.Drawing.Size(, );
this.Controls.Add(this.btnClose);
this.Controls.Add(this.lblMsg);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Msg";
this.Text = "Msg";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Msg_FormClosing);
this.Load += new System.EventHandler(this.Msg_Load);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.FrmLogin_MouseDown);
this.ResumeLayout(false); } #endregion private System.Windows.Forms.Label lblMsg;
private System.Windows.Forms.Button btnClose;
}
}

主窗体:

/*
说明:
* Msg msg = new Msg();
if (AnimateWindow(msg.Handle, 500, AnimationType.AW_HOR_POSITIVE | AnimationType.AW_VER_NEGATIVE | AnimationType.AW_SLIDE))
{
msg.Show();
}
* 等方式为了演示多效果,具体实现时将 AnimateWindow 方法放在 窗体的 Load,Close 事件中
*/
using System.Runtime.InteropServices; namespace Windows_API_实现屏幕右下角_消息框_
{
public partial class frmMain : Form
{ #region WinAPI http://msdn.microsoft.com/en-us/library/ms632669%28VS.85%29.aspx
/// <summary>
/// Enables you to produce special effects when showing or hiding windows. There are four types of animation: roll, slide, collapse or expand, and alpha-blended fade.
/// </summary>
/// <param name="handle">A handle to the window to animate. The calling thread must own this window.</param>
/// <param name="time">The time it takes to play the animation, in milliseconds. Typically, an animation takes 200 milliseconds to play. </param>
/// <param name="type">The type of animation. This parameter can be one or more of the following values. Note that, by default, these flags take effect when showing a window. To take effect when hiding a window, use AW_HIDE and a logical OR operator with the appropriate flags. </param>
/// <returns>If the function succeeds, the return value is nonzero.</returns>
[DllImport("user32.dll", CharSet = CharSet.Auto, EntryPoint = "AnimateWindow")]
private static extern bool AnimateWindow(IntPtr handle, int time, AnimationType type);
#endregion
public frmMain()
{
InitializeComponent();
}
#region Direction
/// <summary>
/// 自下而上入/出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPopup_BottomTop_Click(object sender, EventArgs e)
{
if (msg == null)
msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_NEGATIVE | AnimationType.AW_SLIDE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_NEGATIVE | AnimationType.AW_SLIDE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 自上而下入/出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPopup_TopBottom_Click(object sender, EventArgs e)
{
if (msg == null) msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_POSITIVE | AnimationType.AW_SLIDE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_POSITIVE | AnimationType.AW_SLIDE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 自下而上显/隐
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDraw_BottomTop_Click(object sender, EventArgs e)
{
if (msg == null) msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_NEGATIVE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_NEGATIVE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 自上而下显/隐
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDraw_TopBottom_Click(object sender, EventArgs e)
{
if (msg == null) msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_POSITIVE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_POSITIVE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 从左到右入/出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPopup_LeftRight_Click(object sender, EventArgs e)
{
if (msg == null) msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE | AnimationType.AW_SLIDE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE | AnimationType.AW_SLIDE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 从右到左入/出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPopup_RightLeft_Click(object sender, EventArgs e)
{
if (msg == null) msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_NEGATIVE | AnimationType.AW_SLIDE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_NEGATIVE | AnimationType.AW_SLIDE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 从左到右显/隐
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDraw_LeftRight_Click(object sender, EventArgs e)
{
if (msg == null) msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 从右到左显/隐
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDraw_RightLeft_Click(object sender, EventArgs e)
{
if (msg == null) msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_NEGATIVE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_NEGATIVE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
#endregion
/// <summary>
/// 由内向外显/隐
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnSpreadInOut_Click(object sender, EventArgs e)
{
if (msg == null)
msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_CENTER))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_CENTER | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
} private static Msg msg;
/// <summary>
/// 淡入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_FadeInOut_Click(object sender, EventArgs e)
{
if (msg == null)
msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_BLEND))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_BLEND | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 左斜角向上入/出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPopup_Left_AngleUpward_Click(object sender, EventArgs e)
{
if (msg == null)
msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE | AnimationType.AW_VER_NEGATIVE | AnimationType.AW_SLIDE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE | AnimationType.AW_VER_NEGATIVE | AnimationType.AW_SLIDE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 右斜角向上入/出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPopup_Right_AngleUpward_Click(object sender, EventArgs e)
{
if (msg == null)
msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_NEGATIVE | AnimationType.AW_HOR_NEGATIVE | AnimationType.AW_SLIDE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_NEGATIVE | AnimationType.AW_HOR_NEGATIVE | AnimationType.AW_SLIDE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 左斜角向下入/出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPopup_Left_BevelDown_Click(object sender, EventArgs e)
{
if (msg == null)
msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE | AnimationType.AW_VER_POSITIVE | AnimationType.AW_SLIDE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE | AnimationType.AW_VER_POSITIVE | AnimationType.AW_SLIDE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 右斜角向下入/出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPopup_Right_BevelDown_Click(object sender, EventArgs e)
{
if (msg == null)
msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_NEGATIVE | AnimationType.AW_VER_POSITIVE | AnimationType.AW_SLIDE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_NEGATIVE | AnimationType.AW_VER_POSITIVE | AnimationType.AW_SLIDE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 左斜角向上显/隐
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDraw_Left_AngleUpward_Click(object sender, EventArgs e)
{
if (msg == null)
msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE | AnimationType.AW_VER_NEGATIVE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE | AnimationType.AW_VER_NEGATIVE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 右斜角向上显/隐
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDraw_Right_AngleUpward_Click(object sender, EventArgs e)
{
if (msg == null)
msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_NEGATIVE | AnimationType.AW_HOR_NEGATIVE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_VER_NEGATIVE | AnimationType.AW_HOR_NEGATIVE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 左斜角向下显/隐
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDraw_Left_BevelDown_Click(object sender, EventArgs e)
{
if (msg == null)
msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE | AnimationType.AW_VER_POSITIVE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_POSITIVE | AnimationType.AW_VER_POSITIVE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
/// <summary>
/// 右斜角向下显/隐
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDraw_Right_BevelDown_Click(object sender, EventArgs e)
{
if (msg == null)
msg = new Msg();
if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_NEGATIVE | AnimationType.AW_VER_POSITIVE))
{
msg.Show();
}
else if (AnimateWindow(msg.Handle, , AnimationType.AW_HOR_NEGATIVE | AnimationType.AW_VER_POSITIVE | AnimationType.AW_HIDE))
{
msg.Close();
msg = null;
}
}
}
public enum AnimationType : int
{
/// <summary>
/// Animates the window from left to right. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.
/// </summary>
AW_HOR_POSITIVE = 0x00000001,
/// <summary>
/// Animates the window from right to left. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.
/// </summary>
AW_HOR_NEGATIVE = 0x00000002,
/// <summary>
/// Animates the window from top to bottom. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.
/// </summary>
AW_VER_POSITIVE = 0x00000004,
/// <summary>
/// Animates the window from bottom to top. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.
/// </summary>
AW_VER_NEGATIVE = 0x00000008,
/// <summary>
/// Makes the window appear to collapse inward if AW_HIDE is used or expand outward if the AW_HIDE is not used. The various direction flags have no effect.
/// </summary>
AW_CENTER = 0x00000010,
/// <summary>
/// Hides the window. By default, the window is shown.
/// </summary>
AW_HIDE = 0x00010000,
/// <summary>
/// Activates the window. Do not use this value with AW_HIDE.
/// </summary>
AW_ACTIVATE = 0x00020000,
/// <summary>
/// Uses slide animation. By default, roll animation is used. This flag is ignored when used with AW_CENTER.
/// </summary>
AW_SLIDE = 0x00040000,
/// <summary>
/// Uses a fade effect. This flag can be used only if hwnd is a top-level window.
/// </summary>
AW_BLEND = 0x00080000
}
}
namespace Windows_API_实现屏幕右下角_消息框_
{
partial class frmMain
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #region Windows 窗体设计器生成的代码 /// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.btnPopup_BottomTop = new System.Windows.Forms.Button();
this.btnPopup_TopBottom = new System.Windows.Forms.Button();
this.btnDraw_TopBottom = new System.Windows.Forms.Button();
this.btnDraw_BottomTop = new System.Windows.Forms.Button();
this.btnDraw_RightLeft = new System.Windows.Forms.Button();
this.btnDraw_LeftRight = new System.Windows.Forms.Button();
this.btnPopup_RightLeft = new System.Windows.Forms.Button();
this.btnPopup_LeftRight = new System.Windows.Forms.Button();
this.btnSpreadInOut = new System.Windows.Forms.Button();
this.btn_FadeInOut = new System.Windows.Forms.Button();
this.btnDraw_Right_BevelDown = new System.Windows.Forms.Button();
this.btnDraw_Right_AngleUpward = new System.Windows.Forms.Button();
this.btnPopup_Right_BevelDown = new System.Windows.Forms.Button();
this.btnPopup_Right_AngleUpward = new System.Windows.Forms.Button();
this.btnDraw_Left_BevelDown = new System.Windows.Forms.Button();
this.btnDraw_Left_AngleUpward = new System.Windows.Forms.Button();
this.btnPopup_Left_BevelDown = new System.Windows.Forms.Button();
this.btnPopup_Left_AngleUpward = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnPopup_BottomTop
//
this.btnPopup_BottomTop.Location = new System.Drawing.Point(, );
this.btnPopup_BottomTop.Name = "btnPopup_BottomTop";
this.btnPopup_BottomTop.Size = new System.Drawing.Size(, );
this.btnPopup_BottomTop.TabIndex = ;
this.btnPopup_BottomTop.Text = "自下而上入/出";
this.btnPopup_BottomTop.UseVisualStyleBackColor = true;
this.btnPopup_BottomTop.Click += new System.EventHandler(this.btnPopup_BottomTop_Click);
//
// btnPopup_TopBottom
//
this.btnPopup_TopBottom.Location = new System.Drawing.Point(, );
this.btnPopup_TopBottom.Name = "btnPopup_TopBottom";
this.btnPopup_TopBottom.Size = new System.Drawing.Size(, );
this.btnPopup_TopBottom.TabIndex = ;
this.btnPopup_TopBottom.Text = "自上而下入/出";
this.btnPopup_TopBottom.UseVisualStyleBackColor = true;
this.btnPopup_TopBottom.Click += new System.EventHandler(this.btnPopup_TopBottom_Click);
//
// btnDraw_TopBottom
//
this.btnDraw_TopBottom.Location = new System.Drawing.Point(, );
this.btnDraw_TopBottom.Name = "btnDraw_TopBottom";
this.btnDraw_TopBottom.Size = new System.Drawing.Size(, );
this.btnDraw_TopBottom.TabIndex = ;
this.btnDraw_TopBottom.Text = "自上而下显/隐";
this.btnDraw_TopBottom.UseVisualStyleBackColor = true;
this.btnDraw_TopBottom.Click += new System.EventHandler(this.btnDraw_TopBottom_Click);
//
// btnDraw_BottomTop
//
this.btnDraw_BottomTop.Location = new System.Drawing.Point(, );
this.btnDraw_BottomTop.Name = "btnDraw_BottomTop";
this.btnDraw_BottomTop.Size = new System.Drawing.Size(, );
this.btnDraw_BottomTop.TabIndex = ;
this.btnDraw_BottomTop.Text = "自下而上显/隐";
this.btnDraw_BottomTop.UseVisualStyleBackColor = true;
this.btnDraw_BottomTop.Click += new System.EventHandler(this.btnDraw_BottomTop_Click);
//
// btnDraw_RightLeft
//
this.btnDraw_RightLeft.Location = new System.Drawing.Point(, );
this.btnDraw_RightLeft.Name = "btnDraw_RightLeft";
this.btnDraw_RightLeft.Size = new System.Drawing.Size(, );
this.btnDraw_RightLeft.TabIndex = ;
this.btnDraw_RightLeft.Text = "从右到左显/隐";
this.btnDraw_RightLeft.UseVisualStyleBackColor = true;
this.btnDraw_RightLeft.Click += new System.EventHandler(this.btnDraw_RightLeft_Click);
//
// btnDraw_LeftRight
//
this.btnDraw_LeftRight.Location = new System.Drawing.Point(, );
this.btnDraw_LeftRight.Name = "btnDraw_LeftRight";
this.btnDraw_LeftRight.Size = new System.Drawing.Size(, );
this.btnDraw_LeftRight.TabIndex = ;
this.btnDraw_LeftRight.Text = "从左到右显/隐";
this.btnDraw_LeftRight.UseVisualStyleBackColor = true;
this.btnDraw_LeftRight.Click += new System.EventHandler(this.btnDraw_LeftRight_Click);
//
// btnPopup_RightLeft
//
this.btnPopup_RightLeft.Location = new System.Drawing.Point(, );
this.btnPopup_RightLeft.Name = "btnPopup_RightLeft";
this.btnPopup_RightLeft.Size = new System.Drawing.Size(, );
this.btnPopup_RightLeft.TabIndex = ;
this.btnPopup_RightLeft.Text = "从右到左入/出";
this.btnPopup_RightLeft.UseVisualStyleBackColor = true;
this.btnPopup_RightLeft.Click += new System.EventHandler(this.btnPopup_RightLeft_Click);
//
// btnPopup_LeftRight
//
this.btnPopup_LeftRight.Location = new System.Drawing.Point(, );
this.btnPopup_LeftRight.Name = "btnPopup_LeftRight";
this.btnPopup_LeftRight.Size = new System.Drawing.Size(, );
this.btnPopup_LeftRight.TabIndex = ;
this.btnPopup_LeftRight.Text = "从左到右入/出";
this.btnPopup_LeftRight.UseVisualStyleBackColor = true;
this.btnPopup_LeftRight.Click += new System.EventHandler(this.btnPopup_LeftRight_Click);
//
// btnSpreadInOut
//
this.btnSpreadInOut.Location = new System.Drawing.Point(, );
this.btnSpreadInOut.Name = "btnSpreadInOut";
this.btnSpreadInOut.Size = new System.Drawing.Size(, );
this.btnSpreadInOut.TabIndex = ;
this.btnSpreadInOut.Text = "伸/缩";
this.btnSpreadInOut.UseVisualStyleBackColor = true;
this.btnSpreadInOut.Click += new System.EventHandler(this.btnSpreadInOut_Click);
//
// btn_FadeInOut
//
this.btn_FadeInOut.Location = new System.Drawing.Point(, );
this.btn_FadeInOut.Name = "btn_FadeInOut";
this.btn_FadeInOut.Size = new System.Drawing.Size(, );
this.btn_FadeInOut.TabIndex = ;
this.btn_FadeInOut.Text = "淡入/出";
this.btn_FadeInOut.UseVisualStyleBackColor = true;
this.btn_FadeInOut.Click += new System.EventHandler(this.btn_FadeInOut_Click);
//
// btnDraw_Right_BevelDown
//
this.btnDraw_Right_BevelDown.Location = new System.Drawing.Point(, );
this.btnDraw_Right_BevelDown.Name = "btnDraw_Right_BevelDown";
this.btnDraw_Right_BevelDown.Size = new System.Drawing.Size(, );
this.btnDraw_Right_BevelDown.TabIndex = ;
this.btnDraw_Right_BevelDown.Text = "右斜角向下显/隐";
this.btnDraw_Right_BevelDown.UseVisualStyleBackColor = true;
this.btnDraw_Right_BevelDown.Click += new System.EventHandler(this.btnDraw_Right_BevelDown_Click);
//
// btnDraw_Right_AngleUpward
//
this.btnDraw_Right_AngleUpward.Location = new System.Drawing.Point(, );
this.btnDraw_Right_AngleUpward.Name = "btnDraw_Right_AngleUpward";
this.btnDraw_Right_AngleUpward.Size = new System.Drawing.Size(, );
this.btnDraw_Right_AngleUpward.TabIndex = ;
this.btnDraw_Right_AngleUpward.Text = "右斜角向上显/隐";
this.btnDraw_Right_AngleUpward.UseVisualStyleBackColor = true;
this.btnDraw_Right_AngleUpward.Click += new System.EventHandler(this.btnDraw_Right_AngleUpward_Click);
//
// btnPopup_Right_BevelDown
//
this.btnPopup_Right_BevelDown.Location = new System.Drawing.Point(, );
this.btnPopup_Right_BevelDown.Name = "btnPopup_Right_BevelDown";
this.btnPopup_Right_BevelDown.Size = new System.Drawing.Size(, );
this.btnPopup_Right_BevelDown.TabIndex = ;
this.btnPopup_Right_BevelDown.Text = "右斜角向下入/出";
this.btnPopup_Right_BevelDown.UseVisualStyleBackColor = true;
this.btnPopup_Right_BevelDown.Click += new System.EventHandler(this.btnPopup_Right_BevelDown_Click);
//
// btnPopup_Right_AngleUpward
//
this.btnPopup_Right_AngleUpward.Location = new System.Drawing.Point(, );
this.btnPopup_Right_AngleUpward.Name = "btnPopup_Right_AngleUpward";
this.btnPopup_Right_AngleUpward.Size = new System.Drawing.Size(, );
this.btnPopup_Right_AngleUpward.TabIndex = ;
this.btnPopup_Right_AngleUpward.Text = "右斜角向上入/出";
this.btnPopup_Right_AngleUpward.UseVisualStyleBackColor = true;
this.btnPopup_Right_AngleUpward.Click += new System.EventHandler(this.btnPopup_Right_AngleUpward_Click);
//
// btnDraw_Left_BevelDown
//
this.btnDraw_Left_BevelDown.Location = new System.Drawing.Point(, );
this.btnDraw_Left_BevelDown.Name = "btnDraw_Left_BevelDown";
this.btnDraw_Left_BevelDown.Size = new System.Drawing.Size(, );
this.btnDraw_Left_BevelDown.TabIndex = ;
this.btnDraw_Left_BevelDown.Text = "左斜角向下显/隐";
this.btnDraw_Left_BevelDown.UseVisualStyleBackColor = true;
this.btnDraw_Left_BevelDown.Click += new System.EventHandler(this.btnDraw_Left_BevelDown_Click);
//
// btnDraw_Left_AngleUpward
//
this.btnDraw_Left_AngleUpward.Location = new System.Drawing.Point(, );
this.btnDraw_Left_AngleUpward.Name = "btnDraw_Left_AngleUpward";
this.btnDraw_Left_AngleUpward.Size = new System.Drawing.Size(, );
this.btnDraw_Left_AngleUpward.TabIndex = ;
this.btnDraw_Left_AngleUpward.Text = "左斜角向上显/隐";
this.btnDraw_Left_AngleUpward.UseVisualStyleBackColor = true;
this.btnDraw_Left_AngleUpward.Click += new System.EventHandler(this.btnDraw_Left_AngleUpward_Click);
//
// btnPopup_Left_BevelDown
//
this.btnPopup_Left_BevelDown.Location = new System.Drawing.Point(, );
this.btnPopup_Left_BevelDown.Name = "btnPopup_Left_BevelDown";
this.btnPopup_Left_BevelDown.Size = new System.Drawing.Size(, );
this.btnPopup_Left_BevelDown.TabIndex = ;
this.btnPopup_Left_BevelDown.Text = "左斜角向下入/出";
this.btnPopup_Left_BevelDown.UseVisualStyleBackColor = true;
this.btnPopup_Left_BevelDown.Click += new System.EventHandler(this.btnPopup_Left_BevelDown_Click);
//
// btnPopup_Left_AngleUpward
//
this.btnPopup_Left_AngleUpward.Location = new System.Drawing.Point(, );
this.btnPopup_Left_AngleUpward.Name = "btnPopup_Left_AngleUpward";
this.btnPopup_Left_AngleUpward.Size = new System.Drawing.Size(, );
this.btnPopup_Left_AngleUpward.TabIndex = ;
this.btnPopup_Left_AngleUpward.Text = "左斜角向上入/出";
this.btnPopup_Left_AngleUpward.UseVisualStyleBackColor = true;
this.btnPopup_Left_AngleUpward.Click += new System.EventHandler(this.btnPopup_Left_AngleUpward_Click);
//
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(, );
this.Controls.Add(this.btnDraw_Right_BevelDown);
this.Controls.Add(this.btnDraw_Right_AngleUpward);
this.Controls.Add(this.btnPopup_Right_BevelDown);
this.Controls.Add(this.btnPopup_Right_AngleUpward);
this.Controls.Add(this.btnDraw_Left_BevelDown);
this.Controls.Add(this.btnDraw_Left_AngleUpward);
this.Controls.Add(this.btnPopup_Left_BevelDown);
this.Controls.Add(this.btnPopup_Left_AngleUpward);
this.Controls.Add(this.btn_FadeInOut);
this.Controls.Add(this.btnSpreadInOut);
this.Controls.Add(this.btnDraw_RightLeft);
this.Controls.Add(this.btnDraw_LeftRight);
this.Controls.Add(this.btnPopup_RightLeft);
this.Controls.Add(this.btnPopup_LeftRight);
this.Controls.Add(this.btnDraw_TopBottom);
this.Controls.Add(this.btnDraw_BottomTop);
this.Controls.Add(this.btnPopup_TopBottom);
this.Controls.Add(this.btnPopup_BottomTop);
this.Name = "frmMain";
this.Text = "主窗体";
this.ResumeLayout(false); } #endregion private System.Windows.Forms.Button btnPopup_BottomTop;
private System.Windows.Forms.Button btnPopup_TopBottom;
private System.Windows.Forms.Button btnDraw_TopBottom;
private System.Windows.Forms.Button btnDraw_BottomTop;
private System.Windows.Forms.Button btnDraw_RightLeft;
private System.Windows.Forms.Button btnDraw_LeftRight;
private System.Windows.Forms.Button btnPopup_RightLeft;
private System.Windows.Forms.Button btnPopup_LeftRight;
private System.Windows.Forms.Button btnSpreadInOut;
private System.Windows.Forms.Button btn_FadeInOut;
private System.Windows.Forms.Button btnDraw_Right_BevelDown;
private System.Windows.Forms.Button btnDraw_Right_AngleUpward;
private System.Windows.Forms.Button btnPopup_Right_BevelDown;
private System.Windows.Forms.Button btnPopup_Right_AngleUpward;
private System.Windows.Forms.Button btnDraw_Left_BevelDown;
private System.Windows.Forms.Button btnDraw_Left_AngleUpward;
private System.Windows.Forms.Button btnPopup_Left_BevelDown;
private System.Windows.Forms.Button btnPopup_Left_AngleUpward;
}
}

WinForm利用 WinApi实现 淡入淡出 弹出 效果 仿QQ消息的更多相关文章

  1. JS 点击弹出图片/ 仿QQ商城点击左右滚动幻灯片/ 相册模块,点击弹出图片,并左右滚动幻灯片

    1, 点击弹出图片 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w ...

  2. 利用CSS3制作淡入淡出动画效果

    CSS3新增动画属性“@-webkit-keyframes”,从字面就可以看出其含义——关键帧,这与Flash中的含义一致. 利用CSS3制作动画效果其原理与Flash一样,我们需要定义关键帧处的状态 ...

  3. 利用jquery的淡入淡出函数(fadeIn和fadeOut)--实现轮播

    首先说下,我在网上找的例子全是用的UL 实现,其实大可不必,只要是能包含img标签的HTML标签都可以做轮播效果.利用jquery的淡入淡出函数(fadeIn和fadeOut).废话也不多说,边上代码 ...

  4. jQuery淡入淡出瀑布流效果

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  5. 仿简书、淘宝等等App的View弹出效果

    昨天用简书App的时候觉得这个View的弹出效果特别好,而且非常平滑,所以我就尝试写了一个,和简书App上的效果基本一致了: 下面开始讲解: 1.首先我们要知道这个页面有几个View?这个页面其实有四 ...

  6. Android PopupWindow 仿微信弹出效果

    项目中,我须要PopupWindow的时候特别多,这个东西也特别的好使,所以我今天给大家写一款PopupWindow 仿微信弹出效果.这样大家直接拿到项目里就能够用了! 首先让我们先看效果: 那么我首 ...

  7. Android 仿 新闻阅读器 菜单弹出效果(附源码DEMO)

    这一系列博文都是:(android高仿系列)今日头条 --新闻阅读器 (一) 开发中碰到问题之后实现的,觉得可能有的开发者用的到或则希望独立成一个小功能DEMO,所以就放出来这么一个DEMO. 原本觉 ...

  8. 两种纯CSS方式实现hover图片pop-out弹出效果

    实现原理 主要图形的组成元素由背景和前景图两个元素,以下示例代码中,背景元素使用伪元素 figure::before 表示, 前景元素使用 figure img 表示,当鼠标 hover 悬浮至 fi ...

  9. 利用jQuery的淡入淡出实现轮播器

    基本原理:将所有图片绝对定位在同一位置,透明度设为0,然后通过jQuery的淡入淡出实现图片的切换效果: 但我在使用fadeIn淡入时却无效果,最后只能使用fadeTo实现,求大神指教 HTML: & ...

随机推荐

  1. Flink - FlinkKafkaConsumer08

      先看 AbstractFetcher 这个可以理解就是,consumer中具体去kafka读数据的线程,一个fetcher可以同时读多个partitions的数据来看看 /** * Base cl ...

  2. Listener-监听器+ServletContext+ApplicationContext

    参考资料 ServletContext和ApplicationContext有什么区别 ServletContext:是web容器的东西, 一个webapp一个, 比session作用范围要大, 从中 ...

  3. 【转】NGUI创建UIRoot后报NullReferenceException的解决办法

    本文参考自 http://forum.china.unity3d.com/thread-1099-1-1.html 使用NGUI版本3.7.5. 在创建了一个UIRoot后,有时会报NullRefer ...

  4. 【转】将 azw3 格式转换为 mobi 格式并保持原有排版格式

    小伙伴多次向 Kindle 伴侣提出一个问题,那就是通过 Calibre 将排版精美的 azw3 格式电子书转换成 mobi 格式后推送到 Kindle,排版格式会发生很大的变化,比如行距过窄.内嵌字 ...

  5. JAVA Callable

    Listing -. Calculating Euler’s Number e import java.math.BigDecimal; import java.math.MathContext; i ...

  6. 蓝牙BLE 架构剖析

    一.BLE架构概述: 二.各个层

  7. git项目版本管理

    一个很小的HTML项目,使用.Git来记录和跟踪这个项目.包括以下内容: 创建版本库. 添加与修改文件. 创建新分支. 打标签并整理版本库. 克隆版本库. 创建版本库 Creating a Repos ...

  8. jQuery 复选框全选反选

    <script type="text/javascript"> $(function(){ //全选 $("#CheckedAll").click( ...

  9. Oracle数据导入导出imp/exp

    功能:Oracle数据导入导出imp/exp就相当与oracle数据还原与备份. 大多情况都可以用Oracle数据导入导出完成数据的备份和还原(不会造成数据的丢失). Oracle有个好处,虽然你的电 ...

  10. xcode5 和code6中push后方法执行的先后问题

    在xocde5中 执行的顺序是 prepareForSegue  .viewDidLoad. didSelectRowAtIndexPath,在xcode6中 执行的顺序是  prepareForSe ...