求类似Foxmail的写新邮件时,收件人处的Edit控件的实现方法或类似控件 ( 积分: 300 )

  • 主题发起人 主题发起人 thinknet
  • 开始时间 开始时间
T

thinknet

Unregistered / Unconfirmed
GUEST, unregistred user!
在Foxmail中,写新邮件时,在收件人处有一个Edit(TzRichedit)控件,效果不错,但做了好久均不理想。不知道它是如何实现的,或是否有类似控件存在。
 
是这儿没人还是大家不明白什么意思?还是不知道?
 
unit zRichEdit;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
StdCtrls, ComCtrls, RichEdit;

type
TzRichEdit = class(TRichEdit)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
procedure Justify;
published
{ Published declarations }
end;

procedure Register;

implementation

procedure TzRichEdit.Justify;
const
WM_USER = $400;
EM_EXSETSEL = (WM_USER + 55);
EM_SETTYPOGRAPHYOPTIONS = (WM_USER + 202);
EM_GETTYPOGRAPHYOPTIONS = (WM_USER + 203);
TO_ADVANCEDTYPOGRAPHY = $1;
mZERO = $0;
var x :tparaformat;
L :LongInt;
cp :charrange;
begin
x.cbSize := sizeof(x);
if SelLength = 0 then
begin
cp.cpMin := 0;
cp.cpMax := length(Text);
SendMessage(Handle,EM_EXSETSEL,mZERO,LPARAM(@cp));
end;
L := SendMessageA(Handle,EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY, TO_ADVANCEDTYPOGRAPHY);
if L = 1 then
begin
SendMessageA(Handle, EM_GETTYPOGRAPHYOPTIONS, mZERO, mZERO);
SendMessage(Handle, EM_GETPARAFORMAT, mZERO, LPARAM(@x));
x.dwMask := PFM_ALIGNMENT;
x.wAlignment := PFA_JUSTIFY;
SendMessage(Handle, EM_SETPARAFORMAT, mZERO, lparam(@x));
end;
cp.cpMin := 0;
cp.cpMax := 0;
SendMessage(Handle,EM_EXSETSEL,mZERO,lparam(@cp));
WordWrap := true;
end;

procedure Register;
begin
RegisterComponents('zComponents', [TzRichEdit]);
end;

end.
 
不是没人会.只是没看到.别急.有人会解决的.....
 
楼上说的对...
 
To:zqw0117
您这段代码是什么用处?我没看明白。
 
没人没人
 
后退
顶部