请问大家:
1、richedit的行间距能不能调整?我找了一下好像不能,有没有三方控件可以实现,要求d7和d2010均可以使用的控件。
2、向richedit写入数据时,垂直滚动条有时在最顶端,有时在最下端,好像不是固定的,有随机的可能?需要专门设置?
3、谢谢大家!
1、richedit的行间距能不能调整?我找了一下好像不能,有没有三方控件可以实现,要求d7和d2010均可以使用的控件。
2、向richedit写入数据时,垂直滚动条有时在最顶端,有时在最下端,好像不是固定的,有随机的可能?需要专门设置?
3、谢谢大家!
解决方案 »
- 水晶报表 连接 access 使用条件筛选 出错
- dbgrid+adoquery的问题?
- 感情又得一跤,散分。。
- 大家好,请帮我看看这个函数,看毛病出在那里!(这是个很实用的函数,可能对大家有点用!)
- 我做了一个dll文件,报如下错该怎样处理??
- dbgrid只能显示254行数据,怎样才能显示2000多行或更多数据?
- 动态库,输入参数中有结构数组,紧跟其后的参数输入错误,地址总是0x0000003b,等待高手。
- 如何把datetime型转换成一年中的第几天?
- 怎么编程比较两编word的文档完全一致,包括字体大小,颜色等等
- 请问DELPHI的CGI问题。。。
- 关于delphi主从表的删除问题
- webbrowser1 访问谷歌 添入 关键字 搜索问题
uses
RichEdit;
{$R *.dfm}procedure RE_SetLineSpacing(ARichEdit: TRichEdit; lineSpacing: Byte);
var
pf2: ParaFormat2;
begin
FillChar(pf2, SizeOf(pf2), 0);
pf2.cbSize := SizeOf(ParaFormat2);
pf2.dwMask := PFM_LINESPACING;
pf2.bLineSpacingRule := lineSpacing;
SendMessage(ARichEdit.Handle, EM_SETPARAFORMAT, 0, Longint(@pf2));
end;// Example: Setlinespacing to 1:
procedure TForm1.Button1Click(Sender: TObject);
begin
RichEdit1.SelectAll;
RE_SetLineSpacing(RichEdit1, strtoint(edit1.Text));
end;
0 Single spacing. The dyLineSpacing member is ignored.
1 One and a half spacing. The dyLineSpacing member is ignored.
2 Double spacing. The dyLineSpacing member is ignored.
3 The dyLineSpacing member specifies the spacing, in twips, from one line to the next.
However, if dyLineSpacing specifies a value that is less than single spacing,
the control displays single-spaced text.
4 The dyLineSpacing member specifies the spacing, in twips, from one line to the next.
The control uses the exact spacing specified, even if dyLineSpacing specifies a value that is
less than single spacing.
5 The value of dyLineSpacing / 20 is the spacing, in lines, from one line to the next.
Thus, setting dyLineSpacing to 20 produces single-spaced text, 40 is double-spaced,
60 is triple-spaced, and so on.
}
//bLineSpacingRule为3,4,5时,dyLineSpacing值才有效
procedure TMyMemo.SetLineSpacing(LineSpacingRule:Byte;lineSpacing:Byte);
var
pf2:ParaFormat2;
begin
try
FillChar(pf2,SizeOf(pf2),0);
pf2.cbSize:=SizeOf(PARAFORMAT2);
pf2.dwMask:=PFM_LINESPACING;
pf2.bLineSpacingRule:=LineSpacingRule;
pf2.dyLineSpacing:=lineSpacing;
if self.SelLength = 0 then
begin
self.SelectAll;
SendMessage(self.Handle,EM_SETPARAFORMAT,0,LParam(@pf2));
self.SelLength := 0;
end
else
begin
SendMessage(self.Handle,EM_SETPARAFORMAT,0,LParam(@pf2));
end;
except on E:Exception do
begin
WriteLog('MyMemo.SetLineSpacing Error:' + E.Message);
end;
end;
end;