在Delphi盒子上找到了一个控件,但是此Edit控件却不有输入中文。奇怪的是此控件用微软拼音就能输入中文,而用其它的像五笔等输入的就为乱码,请问是怎么回事。此控件地址http://www.delphibox.com/article.asp?articleid=1464麻烦各位看一下,谢谢了
解决方案 »
- 请问怎样将如下Indy9的代码改为Indy10(DoRequest,ReadBuffer)重分感谢!
- 日期字段 过滤 SQLSERVER2000数据库 请看清出是SQLSERVER2000数据库 拜请高手解决
- 请教一句sql语言,老是说我格式不对,很简单,搞了一晚上,大家帮帮忙!
- 菜鸟提问:关于ODBC的配置
- Oracle中的某一字段为Date类型,当该字段为空时,BDE报错,怎么回事呢
- 特急&特难!!!!!!!!!!多表关联的自定义查询,你做过吗??你会吗???
- 500分高分!关于xp客户端远程访问2000Server服务器的问题.
- ado连接access数据库,查询条件中时间类型字段sql怎么表达?
- 如何制作模态对话窗?
- 请问用什么函数取得当前系统的日期??
- 如何显示出小数点,急急急
- Sql Server在远程的internet web服务器上,应用程序在本机上,用delphi开发,这样的模式如何?
procedure TCustomASEdit.KeyDown(var Key: word; Shift: TShiftState);
var
TmpS : WideString;
OldCaretPosition : integer;
begin
inherited KeyDown(Key, Shift); OldCaretPosition := CaretPosition;
case Key of
VK_END: CaretPosition := Length(Text);
VK_HOME: CaretPosition := 0;
VK_LEFT:
if ssCtrl in Shift then
CaretPosition := GetPrivWordBeging(CaretPosition)
else
CaretPosition := CaretPosition - 1;
VK_RIGHT:
if ssCtrl in Shift then
CaretPosition := GetNextWordBeging(CaretPosition)
else
CaretPosition := CaretPosition + 1;
VK_DELETE, 8: //删除和回退按键
if not ReadOnly then
begin
if SelLength <> 0 then
begin
if Shift = [ssShift] then
CutToClipboard
else
ClearSelection;
end
else
begin
TmpS := Text;
if TmpS <> '' then
if Key = VK_DELETE then
begin
FActionStack.FragmentDeleted(CaretPosition + 1, TmpS[CaretPosition
+ 1]);
Delete(TmpS, CaretPosition + 1, 1);
end
else
begin {回退}
if CaretPosition > 0 then
FActionStack.FragmentDeleted(CaretPosition,
TmpS[CaretPosition]);
Delete(TmpS, CaretPosition, 1);
CaretPosition := CaretPosition - 1;
end;
Text := TmpS;
end;
end;
VK_INSERT:
if Shift = [ssCtrl] then
CopyToClipboard
else
if Shift = [ssShift] then
PasteFromClipboard;
Ord('c'),
Ord('C'):
if Shift = [ssCtrl] then
CopyToClipboard;
Ord('v'),
Ord('V'):
if Shift = [ssCtrl] then
PasteFromClipboard;
Ord('x'),
Ord('X'):
if Shift = [ssCtrl] then
CutToClipboard;
Ord('z'), Ord('Z'):
if Shift = [ssCtrl] then
UnDo;
end; if Key in [VK_END, VK_HOME, VK_LEFT, VK_RIGHT] then
begin
if ssShift in Shift then
begin
if SelLength = 0 then
FSelStart := OldCaretPosition;
FSelStart := CaretPosition;
FSelLength := FSelLength - (CaretPosition - OldCaretPosition);
end
else
FSelLength := 0;
Invalidate;
end;
UpdateCaretePosition;
end;
procedure TCustomASEdit.KeyPress(var Key: Char);
begin
inherited KeyPress(Key); if (Ord(Key) >= 32) and not ReadOnly then
InsertChar(WideChar(Key));
end;
procedure TCustomASEdit.InsertChar(Ch: WideChar);
begin
if ReadOnly then
Exit; InsertText(Ch);
end;
procedure TCustomASEdit.InsertText(AText: WideString);
var
TmpS : WideString;
begin
if ReadOnly then
Exit; TmpS := Text;
FActionStack.FragmentDeleted(SelStart + 1, Copy(TmpS, SelStart + 1,
SelLength));
Delete(TmpS, SelStart + 1, SelLength);
FActionStack.FragmentInserted(SelStart + 1, Length(AText), SelLength <> 0);
Insert(AText, TmpS, SelStart + 1);
if (MaxLength <= 0) or (Length(TmpS) <= MaxLength) then
begin
Text := TmpS;
CaretPosition := SelStart + Length(AText);
end;
SelLength := 0;
end;