C#在父窗口中调用子窗口的过程:1、创建子窗口对象2、显示子窗口对象笔者的程序中,主窗体MainFrm通过菜单调用子窗口ChildFrm。在窗体中定义了子窗口对象,然后在菜单项点击事件中,加入了如下代码来创建和显示子窗口:Private
childFrm myChildFrm = null; //定...
分类:
其他好文 时间:
2014-05-27 03:10:20
阅读次数:
240
#include #include #include class SpecificWork
{private: int p_;public: SpecificWork(int value) : p_(value) { } void
operator()() { printf("Value is %....
分类:
其他好文 时间:
2014-05-27 03:06:45
阅读次数:
251
private void Time(int i) { Stopwatch sw = new
Stopwatch(); sw.Start(); Thread.Sleep(i); s...
分类:
其他好文 时间:
2014-05-27 01:15:43
阅读次数:
342
类的定义class
Date//用class定义一个类{public://公有成员:内部和外部都可以访问 void SetDate(int y,int m, int d); int
IsLeapYear();//成员函数 void Print();private://私有成员:内部...
分类:
其他好文 时间:
2014-05-27 01:06:01
阅读次数:
280
单例模式:
单例模式又称职责模式;简单的说,一个对象(在学习设计模式之前,需要比较了解面向对象思想)只负责一个特定的任务;单例类:1、构造函数需要标记为private(访问控制:防止外部代码使用new操作符创建对象),单例类不能在其他类中实例化,只能被其自身实例化;2、拥有一个保存类的实例的静态成员...
分类:
Web程序 时间:
2014-05-24 04:25:10
阅读次数:
292
以下是参考代码 //datagridview内嵌控件值修改事件 private void
dgv_CurrentCellDirtyStateChanged(object sender, EventArgs e) { if (dgv.Is...
访问控制符: private、default、protected、public同一个类中 √ √ √
√同一个包中 √ √ √子类中 √ √全局范围 ...
分类:
编程语言 时间:
2014-05-19 15:43:23
阅读次数:
208
volatile:java关键字,意为易变的,不稳定的,标识修饰java同步字段,示例:java单利模式public
class ApplicationCache{ private Map attributeMap; // volatile so that JVM
out-of-order...
分类:
编程语言 时间:
2014-05-19 14:56:56
阅读次数:
334
Context.javapackage edu.interpreter;public class
Context { private String input; private int output; public String getInput() {
return...
分类:
其他好文 时间:
2014-05-19 14:56:22
阅读次数:
322
class Point{ public double x; public double y;}
对于可变的类来说,应该用包含私有域和公有设值方法的类来代替:class Point{ private double x; private double y;
Point(d...
分类:
其他好文 时间:
2014-05-19 12:37:01
阅读次数:
224