2013年5月3日

C#鼠标事件的处理

摘要: 鼠标事件处理 对鼠标操作的处理是应用程序的重要功能之一,在VisualC#中有一些与鼠标操作相关的事件,利用它们可 以方便地进行与鼠标有关的编程。 (1)MouseEnter事件:在鼠标指针进入控件时发生。 (2)MouseMove事件:在鼠标指针移到控件上时发生。事件处理程序接收一个Mous... 阅读全文

posted @ 2013-05-03 15:15 杨柳清枫2012 阅读(1393) 评论(0) 推荐(0)

C# 数据结构第一章

摘要: 绪论: 数据是外部世界信息的计算机化,是计算机加工处理的对象。用计算机处理数据时,需解决的四个问题。 1.如何在计算机中方便,高效地表示和组织数据。 2.如何在计算机存储器中存储数据。 3.如何对存储在计算机中的数据进行操作。 4.必须解决每种数据结构的性能特征。 1.1 数据结构 学习数据结构的必... 阅读全文

posted @ 2013-05-03 10:45 杨柳清枫2012 阅读(210) 评论(0) 推荐(0)

2013年5月2日

第二十三节 局部变量

摘要: 局部变量:在函数内部定义的变量,只在该函数内部有效,他的作用域从定义的地方开始,直到函数结束为止。当调用函数时,变量在内存中创立,当退出函数时,变量从内存中清除。using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Ju{ class Program { static void A() { int a = 10; Console.WriteLine("the A() a is {0}... 阅读全文

posted @ 2013-05-02 23:24 杨柳清枫2012 阅读(185) 评论(0) 推荐(0)

第二十二节 函数的递归

摘要: 递归函数:函数反复调用本身的行为。例如n!=1*2*3*....*n;using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace DiGui{ class Program { static double Fac(double n) { if (n <= 1) return 1; else return n * Fac(n - 1)... 阅读全文

posted @ 2013-05-02 23:03 杨柳清枫2012 阅读(143) 评论(0) 推荐(0)

第二十一节 函数二

摘要: 实参与形参。值传递:发生了实参到形参的数据传递。程序首先为形参,x,y分配内存空间并把实参a, b的值复制一份给形参x,y.实参a,b和形参x,y为两组变量,在内存中占据不同的空间,当值传递完成后,他们便是互不相关的量,形参的变化不会影响实参。他们便是互不相关的量,形参的变化不会影using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace HanShu{ class Program { static double Bigger(double x,... 阅读全文

posted @ 2013-05-02 22:15 杨柳清枫2012 阅读(150) 评论(0) 推荐(0)

2013年5月1日

第二十节 函数

摘要: 函数:是一段被封装起来的能实现一定功能的代码。函数的签名:指明了函数的名称,参数,返回值类型。函数体:函数的具体实现代码定义在签名后的一对大括号中。函数的命名方式。所有的首字母大写。如果在函数A()中调用函数B()A()为主调函数,B()为被调函数。return 语句注意一下几点。1.返回值类型和定义类型一致。2.可以用return 返回表达式。 eg:(x>y)?x:y;3.函数中可以有多个return语句,先执行哪个,就哪个起作用。using System;using System.Collections.Generic;using System.Linq;using System. 阅读全文

posted @ 2013-05-01 22:18 杨柳清枫2012 阅读(134) 评论(0) 推荐(0)

第十九节 数组二

摘要: 二维数组int[,] Matrix = {{1,2,3},{4,,5,6},{7,8,9}};C#中的索引是从0开始计算,因此它的第一个元素是Matrix[0,0]using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ErWei{ class Program { static void Main(string[] args) { int[,] Max = new int[3,3] { {1,2,3},{4... 阅读全文

posted @ 2013-05-01 20:30 杨柳清枫2012 阅读(141) 评论(0) 推荐(0)

2013年4月30日

第十八节 数组(一)

摘要: 数组:具有相同类型的一组数据叫做数组。int[] scores = {};using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ShuZu{ class Program { static void Main(string[] args) { int[] scores = { 1,3,5,7,9}; scores[0] = 2; int sum = scores[... 阅读全文

posted @ 2013-04-30 23:52 杨柳清枫2012 阅读(127) 评论(0) 推荐(0)

第十七节 枚举 结构体

摘要: 枚举类型用关键字 enum声明。using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Meiju{ enum WeekDay{Sun,Mon,Tue,Wed,Thur,Fri,Sat} class Program { static void Main(string[] args) { WeekDay today = WeekDay.Sun; if ((today == Week... 阅读全文

posted @ 2013-04-30 22:50 杨柳清枫2012 阅读(201) 评论(0) 推荐(0)

2013年4月29日

第十六节 流程控制 六

摘要: do while循环do{//循环体}while(循环条件);using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace HE{ class Program { static void Main(string[] args) { int i = 1; int sum = 0; do { sum = sum + i; ... 阅读全文

posted @ 2013-04-29 19:55 杨柳清枫2012 阅读(154) 评论(0) 推荐(0)

导航