1.好象在EDIT中没有什么属性可以使EDIT当中的文本内容显示在EDIT的中间.2.在窗口中放置三个'EDIT'要求在EDIT1中输入汉字,在EDIT2中显示其汉字对应的首字母,在DEIT3中显示其汉字首对应的五笔首个字母.
例如:在DEIT1中输入'我爱你'则在EDIT2中显示'WAN',在EDIT3中显示'QEW'.
例如:在DEIT1中输入'我爱你'则在EDIT2中显示'WAN',在EDIT3中显示'QEW'.
解决方案 »
- 100分:用data pump 从Access数据库向其它数据库转换数据,转换之后字段非空属性和索引都到哪里去了?如何解决?
- 求Delphi数据库开发经典实例精解附书源码
- 送分,在DBGRID 和DBLookupComBox中,如何把动态的数字显示为中文
- 我是borland,大家好,delphi2007你们使用得还满意吗?
- delphi7的bug在delphi2006中依然如故
- 关于delphi语言
- 如何让messagedlg('you sure leave?',mtconfirmation,[mbyes],0)的提示框的关闭铵钮失效?
- QRDBText控键怎么控制换行[在线等待]
- 请教‘怎样正确动态建一个窗体’?
- 还收使用delphi的朋友吗?请教个问题:两个服务器开机启动,服务B需要依赖服务A才能启动,需要做什么特别处理吗?
- 请教大侠们一个关于COM+与用户登陆的安全问题
- 请大家帮我解决一个问题,小弟不胜感激。在此先向大家表示感谢!
TEsiEdit = class(TEdit)
private
FAlignment: TAlignment;
procedure SetAlignment(const Value: TAlignment);
protected
procedure CreateParams(var Params: TCreateParams); override;
public
constructor Create(AOwner: TComponent); override;
published
property Alignment: TAlignment read FAlignment write SetAlignment
default taCenter;
end;constructor TEsiEdit.Create(AOwner: TComponent);
begin
inherited;
FAlignment := taCenter;
end;procedure TEsiEdit.CreateParams(var Params: TCreateParams);
begin
inherited;
case FAlignment of
taCenter:
Params.Style := Params.Style or ES_CENTER;
taLeftJustify :
Params.Style := Params.Style or ES_LEFT;
taRightJustify:
Params.Style := Params.Style or ES_RIGHT;
end;
end;procedure TEsiEdit.SetAlignment(const Value: TAlignment);
begin
FAlignment := Value;
if Handle <> 0 then Perform(CM_RECREATEWND, 0, 0);
end;可以使EDIT当中的文本内容显示在EDIT的中间.
2,显示拼音首字母,很简单,一段函数,你调用就行了,网上到处有,你搜一下,一堆,至于五笔第一个字母,我不知道了。呵呵:) 希望你知道了,告诉我: [email protected]
function TCommF.GetPY(AHzStr: string): string;
const
ChinaCode: array[0..25, 0..1] of Integer = ((1601, 1636), (1637, 1832), (1833, 2077),
(2078, 2273), (2274, 2301), (2302, 2432), (2433, 2593), (2594, 2786), (9999, 0000),
(2787, 3105), (3106, 3211), (3212, 3471), (3472, 3634), (3635, 3722), (3723, 3729),
(3730, 3857), (3858, 4026), (4027, 4085), (4086, 4389), (4390, 4557), (9999, 0000),
(9999, 0000), (4558, 4683), (4684, 4924), (4925, 5248), (5249, 5589));
var
i, j, HzOrd: integer;
Hz: string[2];
begin
result:= '';
i := 1;
while i <= Length(AHzStr) do
begin
if (AHzStr[i] >= #160) and (AHzStr[i + 1] >= #160) then
begin
HzOrd := (Ord(AHzStr[i]) - 160) * 100 + Ord(AHzStr[i + 1]) - 160;
for j := 0 to 25 do
begin
if (HzOrd >= ChinaCode[j][0]) and (HzOrd <= ChinaCode[j][1]) then
begin
Result := Result + char(byte('A') + j);
break;
end;
end;
Inc(i);
end
else Result := Result + AHzStr[i];
Inc(i);
end;
end;
使用
str:=GetPY('中华人民共和国')
Edit1.Refresh;