今天图老师小编给大家介绍下TRichEdit右键滚屏代码,平时喜欢TRichEdit右键滚屏代码的朋友赶紧收藏起来吧!记得点赞哦~
【 tulaoshi.com - 编程语言 】
void __fastcall TMainForm::RichEditMouseMove(TObject *Sender,TShiftState Shift, int X, int Y)(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)
{
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;
}
}
来源:http://www.tulaoshi.com/n/20160219/1612463.html
看过《TRichEdit右键滚屏代码》的人还看了以下文章 更多>>