...........
解决方案 »
- 自己写的 新概念学英语软件
- dbexpress(d7)为何不能动态调用有返回结果集的oracle存储过程
- 各位,string 类型长度不够怎么办? 也就是说存不下我给出的
- 使用listview1.items.add时,用vsIcon显示,些时该区大小由imagelist的大小来定,当我改变imagelist中的图片时,必须重新listview1.items
- GGJJ Help me ActiveForm 问题?
- 保存数据时不定时出现一个同一错误!
- 有谁用过:ehlib2.5的弟兄啊,里面的DbgridEH打印的时候能不能把表格先去掉的啊??
- 请问在delphi中,怎么判断一个字符串中是否包含特定的字母,如fat中包含a这个字母?
- TlistView控件,怎么清空其内容?
- 三层中,Socket与DCOM大讨论?? 来者有份!!!!!!!!!
- IDTCPServer的OnExecute事件中将接收的数据写入数据库中?但是它是多线程的,共同访问一个ADOQuery会有问题吗?
- “拨号连接”设置里面如何判断“连接后在通知区域显示图标(&W)”这个Button是否选中?
const
MaxLineCount=5;
begin
if Memo1.Lines.Count>MaxLineCount then
Memo1.Perform(EM_UNDO,0,0);
Memo1.Perform(EM_EMPTYUNDOBUFFER,0,0);
end;
//限制输入行数
每一行输入个数限制:maxlength..
tmemo没有这个功能吧!!
var
CurrentRow: integer;
MaxLineCount,MaxLength: integer;
begin
MaxLineCount:=5;
MaxLength:=10;
CurrentRow:=self.Memo1.CaretPos.Y;
if (Key=#13) then
begin
if (self.Memo1.Lines.Count=MaxLineCount) then
Key:=#0;
end
else if Key<>Char(VK_BACK) then
begin
if (Length(self.Memo1.Lines[CurrentRow])=MaxLength) then
Key:=#0;
end;
end;
const
MaxLineCount=5;
MaxLength=10;
var
CurrentRow: integer;
begin
CurrentRow:=self.Memo1.CaretPos.Y;
if key=#13 then
begin
if self.Memo1.Lines.Count=MaxLineCount then
Key:=#0;
end
else if Key<>Char(VK_BACK) then
begin
if Length(self.Memo1.Lines[CurrentRow])>=MaxLength then //用"="的话最后一个字符输入一个全角字就出问题了
Key:=#0;
end;
end;