Google [站内搜索]

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

for循环小测试(C#)

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

查看更多...

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

namespace WindowsFormsApplication1

查看更多...

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

一种窗体间传值简单方法



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

Form1.cs:

查看更多...

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

.NET ListView控件使用示例

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

查看更多...

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

VB6.0实现托盘图标示例

打开菜单编辑器,添加下边菜单项:



1). 添加模块Tray.bas:

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 5597
在窗体的Load事件中设置DataGridView行高、背景色代码:

private void Form2_Load(object sender, EventArgs e)
{
    using (SqlConnection conn = new SqlConnection("server=(local);database=Northwind;user id=sa;password=sa;"))

查看更多...

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

ComboBox手工添加数据示例

ComboBox.Items.Add参数是object类型的对象,如果用数据绑定可以很容易地实现Text和Value的分别初始化(见《ComboBox绑定数据源示例》一文),但如果要手工添加数据项,就有点困难了,总结了网上方法,有以下两种:

1.使用KeyValuePair

//引用命名空间System.Collections.Generic

查看更多...

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

VB6.0模块和类模块区别

①.模块

Module1.bas代码:
Public Function Addition(a As Integer, b As Integer)
    Addition = a + b

查看更多...

分类:Win编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 6638
//在panel1中添加20个Button
int row = -1;
int rowcount = 5;

for (int i = 1; i <= 20; i++)

查看更多...

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

托盘气球提示示例



代码如下:

notifyIcon1.BalloonTipIcon = ToolTipIcon.Info;

查看更多...

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