发新话题
打印

在C++Builder中同一事件可以在不同的情况下发生两个或两个以上的不同的动作

在C++Builder中同一事件可以在不同的情况下发生两个或两个以上的不同的动作

在程序中同一事件可以在不同的情况下发生两个或两个以上的不同的动作;
以事件OnMouseDown为例:
可定义两个不同的动作函数(参数必须与OnMouseDown相同):
  void_fastcall OnMouseDownBitmap(TObject *Sender,TMouseButton                  Button,TShiftState Shift,int X,int Y);
  void_fastcall OnMouseDownLines(TObject *Sender,TMouseButton                   Button,TShiftState Shift,int X,int Y);
要切换处理程序时只要用语句:
  OnMouseDown=OnMouseDownBitmap;或者
  OnMouseDown=OnMouseDownLines;
我是猪,我想飞!

TOP

阿纬有研究tcp/ip 吗?封包技术?

TOP

没有,现在还处于初级阶段,越学会的东西越少呀!
我是猪,我想飞!

TOP

呵呵。是阿。。越来越少了

TOP

发新话题