TRichEdit右键滚屏代码[VC/C++编程]
本文“TRichEdit右键滚屏代码[VC/C++编程]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
void __fastcall TMainForm::RichEditMouseMove(TObject *Sender,TShiftState Shift, int X, int Y)
{
if(RightButtonFlag)
{
if(RightY>(Y+8))
{
RightY=Y;
SendMessage(RichEdit->Handle, EM_SCROLL, SB_LINEDOWN, 0);
}
else if(RightY<(Y-8))
{
RightY=Y;
SendMessage(RichEdit->Handle, EM_SCROLL, SB_LINEUP, 0);
}
RichEditDragFlag=true;
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::RichEditMouseDown(TObject *Sender,TMouseButton Button, TShiftState Shift, int X, int Y)
{
if(Button==mbRight)
{
RightButtonFlag=true;
Screen->Cursor=crHandPoint;
RightX=X;
RightY=Y;
SetCapture(RichEdit->Handle);
}
else
RightButtonFlag=false;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::RichEditMouseUp(TObject *Sender,TMouseButton Button, TShiftState Shift, int X, int Y)
{
if(RightButtonFlag)
ReleaseCapture();
if(RichEditDragFlag)
{
RightButtonFlag=false;
RichEditDragFlag=false;
Screen->Cursor=crDefault;
RichEdit->PopupMenu=NULL;
}
else
{
RichEdit->PopupMenu=RichEditPopupMenu;
}
}
以上是“TRichEdit右键滚屏代码[VC/C++编程]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |