Google [站内搜索]

分类: Win编程预览模式: 普通 | 列表

获取DataTable单元格修改前的值示例

//创建 DataTable
DataTable categories = new DataTable("Categories");

//添加字段
DataColumn column = new DataColumn();

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 7366
using System;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 7250

C#导出 Windows 事件日志

using System;
using System.Windows.Forms;
using System.Diagnostics;

namespace WindowsFormsApplication1

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 6793

DataGridView底部添加统计行示例

效果图:



查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 7799

窗体最小化再恢复后绘图消失解决方法

private void button1_Click(object sender, EventArgs e)
{
    using (Graphics graphics = this.CreateGraphics())
    {
        graphics.DrawString("木子屋:http://www.mzwu.com/", new Font("宋体", 15), new SolidBrush(Color.Red), 0, 0);

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 6123

DataGridView空白区域用网格填充示例



如上图示,当行数不够时,DataGridView下部分是一块空白区域,不怎么美观,就想用网格来填充。最后的思路是手工绘制线条来完成,只要能找着下图几个红色位置的坐标,其他就好办了:

查看更多...

分类:Win编程 | 固定链接 | 评论: 1 | 引用: 0 | 查看次数: 11404

for循环小测试(C#)

static void Main(string[] args)
{
    for (int i = 0; i < Number(); i++)
        Console.WriteLine(i);

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4478
Program.cs:
using System;
using System.Windows.Forms;

namespace WindowsFormsApplication1

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4201

一种窗体间传值简单方法



上图所示的窗体传值示例,在windows应用程序中经常都会碰到,以前是想办法将form1对象传给form2,然后在form2中在适当的时机调用form1对象上的控件并设置值:

Form1.cs:

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 3892

.NET ListView控件使用示例

//设置
listView1.View = View.Details;
listView1.GridLines = true;
listView1.FullRowSelect = true;
listView1.CheckBoxes = true;

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4736