完结撒花
完结撒花
每添加一个控件都添加一个代码
具体
designer
form1 放功能性dai'ma
as :类的转换
转换失败不会报错,会返回null
创建线程:
方法一:
ThreadStart start = new ThreadStart(ChildThreadMethod);//线程执行方法;
Thread childThread = new Thread(start);
childThread.Start();
方法二:
Thread childThread = new Thread(new ThreadStart(ChildThreadMethod));
childThread.Start();
线程暂停:
Thread.Sleep(1);
线程终止:
childThread.Abort();
10:04C#Part语法,允许一个类在两个cs文件里分开声明【分类管理】
lock()加锁,解决线程冲突,同时调用的问题
Father声明的对象只能调用Father内的函数
Father f=new Father;
Son s=(Son)f;不能运行
Father f=new Son;
Son s=(Son)f;能运行
//f是按战斗机Son构造的,但我们当客机Father用,实际上还是有战斗机的功能,也能当客机,但按客机构造只能做客机
Thread 线程
ThreadStart 线程执行体
ThreadStart start = new ThreadStart(线程要执行的方法)
Thread tr = new Thread(new ThreadStart(方法))
此时 tr.Start()之后 会新开启一个线程来执行参数中的方法了
多个线程同步执行 谁快谁慢不que
this.startpostion = formstartposition.manual
this.location = new point()
designer里面放设计相关的代码, 窗体的设计,外观。
Form1.resx里面放业务相关的代码。
50像素约等于1厘米。
Image image = Properties.Resources.Boss;
Bitmap bm = properties.Resources.EXP4
g.DrawImage(bm,150,150);
console.readline();
静态方法:可以通过类调用
普通方法:只能通过对象调用
int sleepTime = 1000/60
挺好的。最大的精髓在于前期几个静态类和基类的设计。
create my tank