随笔分类 -  C#

格式化数据输出_string.Format
摘要:textBox1.Text = string.Format("{0:F2}", data1);//小数点后保留两位,即使如2,保留成2.00目前只用了上面这个。先留着,以后看。http://msdn.microsoft.com/zh-cn/library/system.string.format(v=VS.80).aspx// This code example demonstrates the String.Format() method.// Formatting for this example uses the "en-US" culture.u 阅读全文

posted @ 2013-05-03 14:38 laymond 阅读(239) 评论(0) 推荐(0)

控件焦点_转移
摘要:转自http://blog.csdn.net/candy1232009/article/details/7557729在C#编程时,有时希望通过按回车键,控件焦点就会自动从一个控件跳转到下一个控件进行操作。 下面通过登录界面为例,讲解两种实现方法。问题描述: 以登录界面为例,当输入完用户名后, 若要输入密码,则密码对应的TextBox必须获得焦点, 一般的办法是用鼠标去点击就可以了。但是这样用户体验就会差一些(因为这样既要操作鼠标,又要操作键盘),其实可以实现按回车键就能自动获得下一个控件的焦点,这样直接用键盘输入就可以了,避免了鼠标的操作。//解决办法一: 判断按键,手工跳转到指定法控... 阅读全文

posted @ 2013-05-03 11:21 laymond 阅读(1433) 评论(0) 推荐(0)

TextBox 智能感应
摘要: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.Threading.Tasks; 9 using System.Windows.Forms;10 using System.Diagnostics;11 using System.Windows;12 13 namespace . 阅读全文

posted @ 2013-04-30 20:29 laymond 阅读(251) 评论(0) 推荐(0)

Process类:启动和停止本地系统进程
摘要:Process.Start 方法 (String, String)通过指定应用程序的名称和一组命令行参数来启动一个进程资源。(并将该资源与新的Process组件相关联)如果没有启动资源,则返回nullProcess.Start("d:\\0.jpg");Process.StartInfo 属性获取或设置要传递给Process的Start方法的属性。ProcessStartInfo.Arguments 属性获取或设置启动应用程序时要使用的一组命令行参数。ProcessStartInfo.FileName 属性获取或设置要启动的应用程序或文档。ProcessStartInfo. 阅读全文

posted @ 2013-04-29 11:31 laymond 阅读(523) 评论(0) 推荐(0)

Invalidate 重绘控件
摘要:涉及: Onpaint DataFormats数据格式 e.Data.GetData DragDropEffects:拖放操作的效果 e.Data.GetDataPresent(比较?) this.PointToClient e.Graphics.DrawImage 阅读全文

posted @ 2013-04-27 14:31 laymond 阅读(244) 评论(0) 推荐(0)

导航