在c# winform的程序中怎么做像MSN那样的消息窗体呀???多谢 在c# winform的程序中怎么做像MSN那样的消息窗体呀???多谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;namespace Test___{ /// <summary> /// Popup 的摘要说明。 /// </summary> public class Popup : System.Windows.Forms.Form { private System.Windows.Forms.Label label1; private System.Windows.Forms.Timer timer1; private System.ComponentModel.IContainer components; public Popup() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // } /// <summary> /// 清理所有正在使用的资源。 /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if(components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows 窗体设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.label1 = new System.Windows.Forms.Label(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // label1 // this.label1.Location = new System.Drawing.Point(16, 28); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(164, 60); this.label1.TabIndex = 0; this.label1.Text = "文本内容"; // // timer1 // this.timer1.Interval = 50; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // Popup // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.ClientSize = new System.Drawing.Size(200, 116); this.Controls.Add(this.label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Location = new System.Drawing.Point(824, 768); this.Name = "Popup"; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "Popup"; this.TopMost = true; this.Load += new System.EventHandler(this.Popup_Load); this.ResumeLayout(false); } #endregion private bool blCountWait = false; int nStart = 0; private void timer1_Tick(object sender, System.EventArgs e) { if (!blCountWait) { if(this.Height +this.Top >Screen.PrimaryScreen.Bounds.Height) { this.Top-=10; } else { blCountWait = true; nStart = System.Environment.TickCount; } } else { if (System.Environment.TickCount - nStart>5000) { this.Close(); } } } private void Popup_Load(object sender, System.EventArgs e) { timer1.Enabled = true; } }} 上面的是弹出式窗体模拟代码。退出可以使用改变透明度退出。效果更好。调用代码如下:private void button7_Click(object sender, System.EventArgs e){ System.Threading.WaitCallback wcbPop = new System.Threading.WaitCallback(PopForm); System.Threading.ThreadPool.QueueUserWorkItem(wcbPop,new Popup());} private void PopForm(object frm){ Application.Run(frm as Popup);} http://www.codeproject.com/aspnet/asppopup.asp assembly.loadFrom() 能否随便加载一个DLL? 有谁知到此时此刻的this表示什么意思? return与break的疑惑! 在类A里触发的事件。我在类B里需要用。 为什么单击按扭,要单击两次GrideView才绑定刷新,在线等,急,谢谢。。。 高分求助,分不够可以加!如何C#调用VC写的dll???? 动态设置菜单项状态 ReadBase64 C# VS2005调试问题求助 谁有《Windows 2000 活动目录》一书电子版? C#调用C++函数问题 高手请进,做个像tabControl效果的东西
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;namespace Test___
{
/// <summary>
/// Popup 的摘要说明。
/// </summary>
public class Popup : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Timer timer1;
private System.ComponentModel.IContainer components; public Popup()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent(); //
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
} /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
} #region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.label1 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(16, 28);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(164, 60);
this.label1.TabIndex = 0;
this.label1.Text = "文本内容";
//
// timer1
//
this.timer1.Interval = 50;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// Popup
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(200, 116);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Location = new System.Drawing.Point(824, 768);
this.Name = "Popup";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "Popup";
this.TopMost = true;
this.Load += new System.EventHandler(this.Popup_Load);
this.ResumeLayout(false); }
#endregion private bool blCountWait = false;
int nStart = 0;
private void timer1_Tick(object sender, System.EventArgs e)
{
if (!blCountWait)
{
if(this.Height +this.Top >Screen.PrimaryScreen.Bounds.Height)
{
this.Top-=10;
}
else
{
blCountWait = true;
nStart = System.Environment.TickCount;
}
}
else
{
if (System.Environment.TickCount - nStart>5000)
{
this.Close();
}
}
} private void Popup_Load(object sender, System.EventArgs e)
{
timer1.Enabled = true;
}
}
}
private void button7_Click(object sender, System.EventArgs e)
{
System.Threading.WaitCallback wcbPop =
new System.Threading.WaitCallback(PopForm);
System.Threading.ThreadPool.QueueUserWorkItem(wcbPop,new Popup());
}
private void PopForm(object frm)
{
Application.Run(frm as Popup);
}