呵呵
明白你的意思了
补充一下
看BeginDrag 的帮助
If Immediate is false, the mouse pointer doesn't change to the value of the DragCursor property and dragging doesn't begin until the user moves the mouse pointer the number of pixels specified by the Threshold parameter.
对于BeginDrag()这个函数,它的第一个参数在帮助里说:
void __fastcall BeginDrag(bool Immediate, int Threshold)
If Immediate is false, the mouse pointer doesn't change to the value of the DragCursor property and.....
可是我在操作的时候觉得并不是这样,当Immediate为false是,鼠标的形状也改变了!和Immediate为true的时候一样!
下面是例子:
Form1中有一个Edit1,一个Memo1。Edit的DragMode设为dmManual,DragCursor 为crCross。
void __fastcall TForm1::Edit1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
Edit1->BeginDrag(false,-1);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Memo1DragOver(TObject *Sender, TObject *Source,
int X, int Y, TDragState State, bool &Accept)
{
if(Source->ClassNameIs("TEdit"))
Accept = true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Memo1DragDrop(TObject *Sender, TObject *Source,
int X, int Y)
{
if((Sender->ClassNameIs("TMemo"))&&(Source->ClassNameIs("TEdit")))
((TMemo*)(Sender))->Lines->Add(((TEdit*)(Source))->Text);
}
运行后,通过鼠标拖动可以把Edit1中的内容拖动到Memo1中!但是不管BeginDrag()第一个的参数设成true或是false,鼠标的形状都变化为十字的形状!
这是怎么回事?
谢谢!