TRichEdit右键滚屏代码

2008-02-23 05:39:05来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

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;
}
}




标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇: C Builder创建组件探密

下一篇: 用CB制作具备HTML风格的动态按钮

热门词条
热门标签