随笔分类 - C#
摘要:代码下载:http://dev.mjxy.cn/a-Custom-TextBox-validation-numbers-and-text.aspxNumbers and Characters only Textbox Validation in C#源文档 <http://www.codeproject.com/KB/cs/TexboxValidation.aspx> 翻译:白水(敏捷学院)介绍在GUI开发中,处理文本框验证是一种很常见的任务。通常情况下,处理一个TextBox只允许用户输入数字(无论是整数或实)或字母字符,我在网络上找到的代码用正则表达式处理这个问题,它工作得很好
阅读全文
摘要:Lesson04 类和对象 演练1 类、对象 类的声明 字段、常量字段及访问级别 读写属性演练 属性演练:限制访问器可访问性 方法 构造函数演练2 类的继承与多态 类的继承 继承、虚方法及类的组合 抽象类 静态类成员 接口 索引器 委托敏捷学院C#基础演练是由敏捷学院推出的适合没有任何编程基础的初学者练习使用演练代码。敏捷学院C#基础演练是为本部学员代码训练使用的内部教程。现在共享给大家。通过认真的完成本演练,您将掌握C#语言的语法,为学习高级的C#开发奠定良好的基础。
阅读全文
摘要:敏捷学院C#基础演练1.0Lesson03 数组、枚举、结构 演练1 数组创建及遍历演示 演练2 将数组做为参数演示 演练3 Out和Ref演练 演练4 Array类Copy,Sort,Reverse方法演练 演练5 枚举演练 演练6 结构演练Lesson04 类和对象敏捷学院C#基础演练是由敏捷学院推出的适合没有任何编程基础的初学者练习使用演练代码。敏捷学院C#基础演练是为本部学员代码训练使用的内部教程。现在共享给大家。通过认真的完成本演练,您将掌握C#语言的语法,为学习高级的C#开发奠定良好的基础。
阅读全文
摘要:敏捷学院C#基础演练1.0更新:2011-07-15 访问:21Lesson01 开发工具的演练Lesson02 输入输出、类型、语句Lesson03 数组、枚举、结构Lesson04 类和对象敏捷学院C#基础演练是由敏捷学院推出的适合没有任何编程基础的初学者练习使用演练代码。敏捷学院C#基础演练是为本部学员代码训练使用的内部教程。现在共享给大家。通过认真的完成本演练,您将掌握C#语言的语法,为学习高级的C#开发奠定良好的基础。
阅读全文
摘要:转自:http://dev.mjxy.cn/a-296.aspxc#如何取消窗体标题栏关闭using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;using System.Windows.Forms;public class Disable{ [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr GetSystemMenu(IntPtr
阅读全文
摘要:转自:http://dev.mjxy.cn/a-Security-Update-Windows-controls-from-another-thread.aspx// Safe update of windows control from other threadsdelegate void UpdateReportCallback(string text);private void UpdateReport(string message){ // InvokeRequired required compares the thread ID of the // calling thread t
阅读全文
摘要:转自:http://dev.mjxy.cn/a-269.aspxusing System;using System.ComponentModel;using System.Windows.Forms;namespace WindowsApplication4...{ /**//// <summary> /// gui 类 /// </summary> public partial class Form1 : Form ...{ public Form1() ...{ InitializeComponent(); } private void button1_Click(
阅读全文
摘要:标准的win32窗口程序相信熟悉windows编程的朋友,对于使用win32 api开发窗口应用程序一定不陌生。 下面的程序是从资源文件中加载一个图片并显示在窗口中。#include <windows.h>#include "resource.h"TCHAR szClassName[] = TEXT("WIN32TEST");HBITMAP hBmp;LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){PAINTSTRUCT ps;HD
阅读全文
摘要:转自: http://dev.mjxy.cn/a-169.aspxusing System;using System.Windows.Forms;using System.Drawing;using System.Drawing.Drawing2D;namespace DevDistrict.Sample{ public class GradientPanel : System.Windows.Forms.Panel { protected override void OnPaint(PaintEventArgs e) { base.OnPaint (e); Graphics g = e.Gr
阅读全文
摘要:转自:http://dev.mjxy.cn/a-166.aspxprivate Image ScaleImage(Image source, int MaxWidth, int MaxHeight){ float MaxRatio = MaxWidth / (float) MaxHeight; float ImgRatio = source.Width / (float) source.Height; if (source.Width > MaxWidth) return new Bitmap(source, new Size(MaxWidth, (int) Math.Round(Max
阅读全文
摘要:1DateTime thisDate1 = new DateTime(2011, 6, 10); 02Console.WriteLine("Today is " + thisDate1.ToString("MMMM dd, yyyy") + "."); 0304DateTimeOffset thisDate2 = new DateTimeOffset(2011, 6, 10, 15, 24, 16, 05TimeSpan.Zero); 06Console.WriteLine("The current date and tim
阅读全文

浙公网安备 33010602011771号