摘要:有三种方式:1.string s = i.ToString("0000");2.i.ToString().PadLeft(4, '0'); 3.i.ToString("d4");
阅读全文
摘要:【以下为网上查询到的方法】 在ASP.NET程序的开发过程中,常常需要向用户给出提示信息,比如是否“操作成功”,“确定”还是“取消”操作: (1) 点击页面上的按钮,弹出一个对话框提示是“确定”还是“取消”操作,我们采用在按钮中添加属性来完成: (2)点击页面上的链接,弹出一个对话框提示是“确定”还
阅读全文
摘要:【转载】先添加Web引用http://www.webxml.com.cn/WebServices/WeatherWebService.asmxusingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsFormsApplication1{publicpartialclassFrmWeahte
阅读全文
摘要:【转载】public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { if (this.Opacity > 0.1) { this.Opacity = this.Opacity - 0.02; } ...
阅读全文
摘要:【转载】 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Windows.Forms; 9 namespace BounHide10 {11 public partial class hide : Form12 {13 public hide()...
阅读全文
摘要:【转载】首先在窗体中添加一个 notifyIcon1控件 ,Then://添加事件《实现最小化之后任务栏显示图标》 private void Form1_StyleChanged(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized) { this.notifyIcon1.Visible = true; this.Visible = false; ...
阅读全文
摘要:1 private void Form1_Load(object sender, EventArgs e) 2 { 3 4 System.Windows.Forms.Timer StopRectTimer = new System.Windows.Forms.Timer(); 5 StopRectTimer.Tick += new EventHandler(timer1_Tick); 6 StopRectTimer.Interval = 50; 7 Sto...
阅读全文
摘要:【转载】当点击窗体1的按钮,窗体2就出现在窗体1的左边:窗体1public partial class Form1 : Form{public Form1(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){Form2 f = new Form2(this.Location.X+this.Width,this.Location.Y);//窗体2出现在左还是右,在new Form2()输入参数f.Show();}}窗体2public partial class Form2 : Form{i
阅读全文
摘要:【转载】//在c# / ASP.net中我们可以通过使用DataTime这个类来获取当前的时间。通过调用类中的各种方法我们可以获取不同的时间:如:日期(2008-09-04)、时间(12:12:12)、日期+时间(2008-09-04 12:11:10)等。//获取日期+时间DateTime.Now.ToString(); // 2008-9-4 20:02:10DateTime.Now.ToLocalTime().ToString(); // 2008-9-4 20:12:12//获取日期DateTime.Now.ToLongDateString().To...
阅读全文