是Asp.NET程序还是WinForm程序?
解决方案 »
- 求助,撒分!!项目从win2003+iis6 移动到win2008+iis7 后项目就出错
- C#中能不能像VBScript或JavaScript中那样有个eval函数,能执行字符串中的代码???
- C#中怎么获得文件打开状态啊?
- 请高手指点(数据交换)
- wcf服务怎么时时刷新每个客户端数据
- 我市菜鸟,救命呀,急用,在线等
- 如何对输入的数字排序 ,保存到动态数组C# 如,8366,45,123,789
- c#实时循环检测数据变化去出发事件
- 我觉得是很基础的问题,有没有人能给我个正确的答复?
- 救命啊,在datagrid中怎樣實現導航啊
- .net beta2的MSDN文件在哪????
- mobile web application 里的softkey到底是怎么回事呀
thanks..
qiuckly!!!
<marquee ....>
//在这里插入想滚动的东西。
</marquee>
具体语法自己查吧,很简单的。
滚动内容
</marquee>
自己写个函数也很简单嘛,要不要我给你写。。?
把分都给我吧
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Timers ;namespace WindowsApplication10
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private int i;
private ArrayList list;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null; public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
list=new ArrayList ();
list.Add("one");
list.Add("two");
list.Add("three");
i=160; //
// TODO: Add any constructor code after InitializeComponent call
//
} ///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
} #region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.label1});
this.panel1.Location = new System.Drawing.Point(144, 64);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(144, 160);
this.panel1.TabIndex = 2;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
//
// label1
//
this.label1.Location = new System.Drawing.Point(0, -144);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(144, 144);
this.label1.TabIndex = 1;
this.label1.Text = "茜茜茜茜我爱你,就像老鼠爱大米!\n茜茜茜茜我爱你,就像老鼠爱大米!\n茜茜茜茜我爱你,就像老鼠爱大米!\n茜茜茜茜我爱你,就像老鼠爱大米!\n茜茜茜茜我爱你,就像老鼠爱" +
"大米!\n";
this.label1.Click += new System.EventHandler(this.label1_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(72, 32);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(72, 40);
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.panel1,
this.button1});
this.Name = "Form1";
this.Text = "Form1";
this.panel1.ResumeLayout(false);
this.ResumeLayout(false); }
#endregion ///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
} private void button1_Click(object sender, System.EventArgs e)
{
System.Timers.Timer timer=new System.Timers.Timer();
timer.Elapsed +=new ElapsedEventHandler(changeText);
//这里可以控制延迟时间,也就是速度
timer.Interval=100;
timer.Enabled=true;
} public void changeText(object source, ElapsedEventArgs e)
{
label1.Location = new System.Drawing.Point(0, i);
i--;
//到最上端出去时,重新开始
if(i==-144) i=160;
} private void label1_Click(object sender, System.EventArgs e)
{ } private void panel1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{ }
}
}