从哪可以下载到一个用到时钟的适时显示的实例? rt适时显示的意思是在不同的时候可以显示不同的内容,其他内容应该就是隐藏了不知道能不能说的清楚,最近做毕设,很郁闷,对c#了解太少 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是不是早某个时间一些控件隐藏,一些显示?用Timer就可以 private void timer1_tick(.......){ timer.interval=10000;//10miao TextBox t=new TextBox(); t.Parent=this; t.left=100; t.right=200;}private void Form1_MouseDown(...........){ timer1.start();}private void Form1_MouseUp(.....){ timer1.Stop();} 做作业!using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.IO;namespace WindowsApplication1{ public partial class Form1 : Form { /// <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.components = new System.ComponentModel.Container(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.button1 = new System.Windows.Forms.Button(); this.richTextBox2 = new System.Windows.Forms.RichTextBox(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // richTextBox1 // this.richTextBox1.Location = new System.Drawing.Point(39, 32); this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(207, 64); this.richTextBox1.TabIndex = 0; this.richTextBox1.Text = ""; // // button1 // this.button1.Location = new System.Drawing.Point(100, 202); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 1; this.button1.Text = "button1"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // richTextBox2 // this.richTextBox2.Location = new System.Drawing.Point(39, 102); this.richTextBox2.Name = "richTextBox2"; this.richTextBox2.Size = new System.Drawing.Size(207, 64); this.richTextBox2.TabIndex = 2; this.richTextBox2.Text = ""; // // timer1 // this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(292, 266); this.Controls.Add(this.richTextBox2); this.Controls.Add(this.button1); this.Controls.Add(this.richTextBox1); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false); } #endregion private System.Windows.Forms.RichTextBox richTextBox1; private System.Windows.Forms.Button button1; private System.Windows.Forms.RichTextBox richTextBox2; private System.Windows.Forms.Timer timer1; public Form1() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { timer1.Interval = 1000; if (richTextBox1.Visible ==true) { richTextBox1.Visible = false; richTextBox2.Visible = true; } else if (richTextBox2.Visible == true) { richTextBox1.Visible = true; richTextBox2.Visible = false; } } private void Form1_Load(object sender, EventArgs e) { richTextBox1.Visible = true; richTextBox2.Visible = false; } private void button1_Click(object sender, EventArgs e) { timer1.Start(); } }} 这个是用MOUSE事件做的,如果是你要的结果,那么记得结贴using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication1{ public partial class Form1 : Form { /// <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.components = new System.ComponentModel.Container(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.button1 = new System.Windows.Forms.Button(); this.richTextBox2 = new System.Windows.Forms.RichTextBox(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // richTextBox1 // this.richTextBox1.Location = new System.Drawing.Point(39, 32); this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(207, 64); this.richTextBox1.TabIndex = 0; this.richTextBox1.Text = ""; // // button1 // this.button1.Location = new System.Drawing.Point(100, 202); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 1; this.button1.Text = "button1"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // richTextBox2 // this.richTextBox2.Location = new System.Drawing.Point(39, 102); this.richTextBox2.Name = "richTextBox2"; this.richTextBox2.Size = new System.Drawing.Size(207, 64); this.richTextBox2.TabIndex = 2; this.richTextBox2.Text = ""; // // timer1 // this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(292, 266); this.Controls.Add(this.richTextBox2); this.Controls.Add(this.button1); this.Controls.Add(this.richTextBox1); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseUp); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown); this.ResumeLayout(false); } #endregion private System.Windows.Forms.RichTextBox richTextBox1; private System.Windows.Forms.Button button1; private System.Windows.Forms.RichTextBox richTextBox2; private System.Windows.Forms.Timer timer1; public Form1() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { timer1.Interval = 1000; if (richTextBox1.Visible ==true) { richTextBox1.Visible = false; richTextBox2.Visible = true; } else if (richTextBox2.Visible == true) { richTextBox1.Visible = true; richTextBox2.Visible = false; } } private void Form1_Load(object sender, EventArgs e) { richTextBox1.Visible = true; richTextBox2.Visible = false; } private void button1_Click(object sender, EventArgs e) { } private void Form1_MouseDown(object sender, MouseEventArgs e) { timer1.Start(); } private void Form1_MouseUp(object sender, MouseEventArgs e) { timer1.Stop(); } }} 不论是winform还是水晶报表,我使用另存为后,在项目中都出现另存为的名字的表单或者水晶报表,原来那个名字的文件却不在项目里面了。这个和我理解有出入啊!! 字符串转换成ascii码 求救 高手请进,一个很困惑的问题!!! 保存信息时,异步发邮件,可行吗? 如果用c#造字 请大家帮个忙,急!!! 手工结束线程,不知道如何做? 如何把新的DLL发个每个客户端,而且客户端在使用,谁帮帮我 WinForms登录验证问题! 求C#电子版书? 在线等,急,循环问题!! 没有修改代码,每次运行为什么需要重新编译?
{
timer.interval=10000;//10miao
TextBox t=new TextBox();
t.Parent=this;
t.left=100;
t.right=200;
}
private void Form1_MouseDown(...........)
{
timer1.start();
}
private void Form1_MouseUp(.....)
{
timer1.Stop();
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;namespace WindowsApplication1
{
public partial class Form1 : Form
{
/// <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.components = new System.ComponentModel.Container();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.button1 = new System.Windows.Forms.Button();
this.richTextBox2 = new System.Windows.Forms.RichTextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// richTextBox1
//
this.richTextBox1.Location = new System.Drawing.Point(39, 32);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(207, 64);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(100, 202);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// richTextBox2
//
this.richTextBox2.Location = new System.Drawing.Point(39, 102);
this.richTextBox2.Name = "richTextBox2";
this.richTextBox2.Size = new System.Drawing.Size(207, 64);
this.richTextBox2.TabIndex = 2;
this.richTextBox2.Text = "";
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.richTextBox2);
this.Controls.Add(this.button1);
this.Controls.Add(this.richTextBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false); } #endregion private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.RichTextBox richTextBox2;
private System.Windows.Forms.Timer timer1; public Form1()
{
InitializeComponent();
} private void timer1_Tick(object sender, EventArgs e)
{
timer1.Interval = 1000;
if (richTextBox1.Visible ==true)
{
richTextBox1.Visible = false;
richTextBox2.Visible = true;
}
else if (richTextBox2.Visible == true)
{
richTextBox1.Visible = true;
richTextBox2.Visible = false;
} } private void Form1_Load(object sender, EventArgs e)
{
richTextBox1.Visible = true;
richTextBox2.Visible = false;
} private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
} }
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
/// <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.components = new System.ComponentModel.Container();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.button1 = new System.Windows.Forms.Button();
this.richTextBox2 = new System.Windows.Forms.RichTextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// richTextBox1
//
this.richTextBox1.Location = new System.Drawing.Point(39, 32);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(207, 64);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(100, 202);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// richTextBox2
//
this.richTextBox2.Location = new System.Drawing.Point(39, 102);
this.richTextBox2.Name = "richTextBox2";
this.richTextBox2.Size = new System.Drawing.Size(207, 64);
this.richTextBox2.TabIndex = 2;
this.richTextBox2.Text = "";
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.richTextBox2);
this.Controls.Add(this.button1);
this.Controls.Add(this.richTextBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseUp);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
this.ResumeLayout(false); } #endregion private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.RichTextBox richTextBox2;
private System.Windows.Forms.Timer timer1; public Form1()
{
InitializeComponent();
} private void timer1_Tick(object sender, EventArgs e)
{
timer1.Interval = 1000;
if (richTextBox1.Visible ==true)
{
richTextBox1.Visible = false;
richTextBox2.Visible = true;
}
else if (richTextBox2.Visible == true)
{
richTextBox1.Visible = true;
richTextBox2.Visible = false;
} } private void Form1_Load(object sender, EventArgs e)
{
richTextBox1.Visible = true;
richTextBox2.Visible = false;
} private void button1_Click(object sender, EventArgs e)
{ } private void Form1_MouseDown(object sender, MouseEventArgs e)
{
timer1.Start();
} private void Form1_MouseUp(object sender, MouseEventArgs e)
{
timer1.Stop();
} }
}