各位老大,怎样做类似msn样式的提示信息窗口 http://www.codechina.com/gotodown.asp?id=1626&item=1你下载看看! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没什么难度.微软社区上有全部的说明.看看http://www.microsoft.com/China/Community/TechZone/TechArticle/TechDoc/vcsharpmsn.asp用Visual C#编写仿MSN Messager的滚动提示窗口http://www.microsoft.com/China/Community/TechZone/TechArticle/TechDoc/csharpui.asp使用Visual C#制作可伸缩个性化窗体 using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;namespace AutoShowHideForm{ /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Button button1; /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (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() { this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // button1 // this.button1.Location = new System.Drawing.Point(144, 200); this.button1.Name = "button1"; this.button1.TabIndex = 0; this.button1.Text = "button1"; this.button1.Click += new System.EventHandler(this.button1_Click); // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.ClientSize = new System.Drawing.Size(292, 273); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.button1}); this.Name = "Form1"; this.Text = "MainForm"; this.ResumeLayout(false); } #endregion /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } private void button1_Click(object sender, System.EventArgs e) { AutoShowHideForm form = new AutoShowHideForm() ; form.Show(); } }}using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;namespace AutoShowHideForm{ /// <summary> /// Summary description for AutoShowHideForm. /// </summary> public class AutoShowHideForm : System.Windows.Forms.Form { private System.ComponentModel.IContainer components; private System.Windows.Forms.Timer TimeShowHideStay; private bool UpOrDown ,Stay; private System.Windows.Forms.CheckBox CheckBoxInform; //*决定移动方向true up ,false down,停留状态 Stay private int ScreenHeight ; //*屏幕 可视高度 public AutoShowHideForm() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // //*初始化 窗体移动方向 ,和停留 状态 UpOrDown = true ; Stay = false ; } /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if(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() { this.components = new System.ComponentModel.Container(); this.TimeShowHideStay = new System.Windows.Forms.Timer(this.components); this.CheckBoxInform = new System.Windows.Forms.CheckBox(); this.SuspendLayout(); // // TimeShowHideStay // this.TimeShowHideStay.Enabled = true; this.TimeShowHideStay.Interval = 10; this.TimeShowHideStay.Tick += new System.EventHandler(this.TimeShowHideStay_Tick); // // CheckBoxInform // this.CheckBoxInform.Location = new System.Drawing.Point(16, 48); this.CheckBoxInform.Name = "CheckBoxInform"; this.CheckBoxInform.TabIndex = 0; this.CheckBoxInform.Text = "今日不再提醒"; // // AutoShowHideForm // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.BackColor = System.Drawing.Color.Lavender; this.ClientSize = new System.Drawing.Size(136, 77); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.CheckBoxInform}); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "AutoShowHideForm"; this.ShowInTaskbar = false; this.Text = "AutoShowHideForm"; this.TopMost = true; this.Load += new System.EventHandler(this.AutoShowHideForm_Load); this.ResumeLayout(false); } #endregion private void AutoShowHideForm_Load(object sender, System.EventArgs e) { Screen[] screens = Screen.AllScreens ; Screen screen = screens[0]; ScreenHeight = screen.WorkingArea.Height ; this.Location = new Point (screen.WorkingArea.Width - this.Width - 20,ScreenHeight - 50); } private void ShowHide() { if( UpOrDown == true ) { //* 向上移动 this.Location = new Point (this.Location.X ,this.Location.Y - 3); if(this.Location.Y < ScreenHeight - this.Height - 30 ) { /* * 停止向上 移动 , 改变下次 移动 方向 UpOrDown = false * 停留 不移动 5 秒 /*/ UpOrDown = false ; TimeShowHideStay.Interval = 5000 ; Stay = true ; } } else { //*向下隐藏 this.Location = new Point (this.Location.X ,this.Location.Y + 3); if(this.Location.Y > ScreenHeight) { TimeShowHideStay.Stop(); TimeShowHideStay.Dispose(); this.Close(); } } } private void TimeShowHideStay_Tick(object sender, System.EventArgs e) { if (Stay == false) { //*移动 ShowHide(); } else { //*停留后 Stay = false ; TimeShowHideStay.Interval = 10 ; ShowHide(); } } //*end class }} seabirdforever(听海) 我晕, 居然不用多线程,呵呵,拿着TIMER玩的这样开心.呵呵,有意思.这个真是VB6的多线程思想啊. [C# TreeNode与TreeView ]关于载入树形目录问题 C#开发的代码的窗口在打开解决方案时不要默认打开! 调试问题 请教:多级联动combobox怎么弄,谢谢! 一个简单的问题 请问:在.aspx中,我生成一个查询后,如何到得数据库表中列名的字符?? "scrollbar-face-color:#6699cc;"这个代码在VS2008的样式表里怎么不支持呀?? 我想使用第三方的控件,怎么做? WPF,自定义控件dll如何使用资源文件 c# DataGridView 单击 表头 时会触发关闭窗体事件 如何让控件得到焦点? 刪除dataView中RowFilter出來的所有行
微软社区上有全部的说明.看看
http://www.microsoft.com/China/Community/TechZone/TechArticle/TechDoc/vcsharpmsn.asp用Visual C#编写仿MSN Messager的滚动提示窗口http://www.microsoft.com/China/Community/TechZone/TechArticle/TechDoc/csharpui.asp使用Visual C#制作可伸缩个性化窗体
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;namespace AutoShowHideForm
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null; public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent(); //
// TODO: Add any constructor code after InitializeComponent call
//
} /// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (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()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(144, 200);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button1});
this.Name = "Form1";
this.Text = "MainForm";
this.ResumeLayout(false); }
#endregion /// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
} private void button1_Click(object sender, System.EventArgs e)
{
AutoShowHideForm form = new AutoShowHideForm() ;
form.Show();
}
}
}using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;namespace AutoShowHideForm
{
/// <summary>
/// Summary description for AutoShowHideForm.
/// </summary>
public class AutoShowHideForm : System.Windows.Forms.Form
{
private System.ComponentModel.IContainer components;
private System.Windows.Forms.Timer TimeShowHideStay;
private bool UpOrDown ,Stay;
private System.Windows.Forms.CheckBox CheckBoxInform; //*决定移动方向true up ,false down,停留状态 Stay
private int ScreenHeight ; //*屏幕 可视高度
public AutoShowHideForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent(); //
// TODO: Add any constructor code after InitializeComponent call
//
//*初始化 窗体移动方向 ,和停留 状态
UpOrDown = true ;
Stay = false ;
} /// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(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()
{
this.components = new System.ComponentModel.Container();
this.TimeShowHideStay = new System.Windows.Forms.Timer(this.components);
this.CheckBoxInform = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// TimeShowHideStay
//
this.TimeShowHideStay.Enabled = true;
this.TimeShowHideStay.Interval = 10;
this.TimeShowHideStay.Tick += new System.EventHandler(this.TimeShowHideStay_Tick);
//
// CheckBoxInform
//
this.CheckBoxInform.Location = new System.Drawing.Point(16, 48);
this.CheckBoxInform.Name = "CheckBoxInform";
this.CheckBoxInform.TabIndex = 0;
this.CheckBoxInform.Text = "今日不再提醒";
//
// AutoShowHideForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.Color.Lavender;
this.ClientSize = new System.Drawing.Size(136, 77);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.CheckBoxInform});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "AutoShowHideForm";
this.ShowInTaskbar = false;
this.Text = "AutoShowHideForm";
this.TopMost = true;
this.Load += new System.EventHandler(this.AutoShowHideForm_Load);
this.ResumeLayout(false); }
#endregion private void AutoShowHideForm_Load(object sender, System.EventArgs e)
{
Screen[] screens = Screen.AllScreens ;
Screen screen = screens[0];
ScreenHeight = screen.WorkingArea.Height ;
this.Location = new Point (screen.WorkingArea.Width - this.Width - 20,ScreenHeight - 50); } private void ShowHide()
{
if( UpOrDown == true )
{
//* 向上移动
this.Location = new Point (this.Location.X ,this.Location.Y - 3);
if(this.Location.Y < ScreenHeight - this.Height - 30 )
{
/*
* 停止向上 移动 , 改变下次 移动 方向 UpOrDown = false
* 停留 不移动 5 秒
/*/
UpOrDown = false ;
TimeShowHideStay.Interval = 5000 ;
Stay = true ;
}
}
else
{
//*向下隐藏
this.Location = new Point (this.Location.X ,this.Location.Y + 3);
if(this.Location.Y > ScreenHeight)
{
TimeShowHideStay.Stop();
TimeShowHideStay.Dispose();
this.Close();
}
}
} private void TimeShowHideStay_Tick(object sender, System.EventArgs e)
{
if (Stay == false)
{
//*移动
ShowHide();
}
else
{
//*停留后
Stay = false ;
TimeShowHideStay.Interval = 10 ;
ShowHide();
}
}
//*end class
}
}
这个真是VB6的多线程思想啊.