有个表保存了地名(汉字)等信息,现在我想在combox输入框中输入地名的第一个字母(或第一和第二个字母)的时候能把首字母含有此字母的地名列出来。
例如:输入"S"能把“山东”、“山西”、“汕头”等列出来。
看了网上一些例子,但总不够理想,希望各位能给个例子。
例如:输入"S"能把“山东”、“山西”、“汕头”等列出来。
看了网上一些例子,但总不够理想,希望各位能给个例子。
解决方案 »
- TreeView 如何去掉不需要的节点及其子节点?
- serverSocket的多线程编程的问题,请各位指点
- idpop31收邮件乱码怎么解决
- 寻找一个控件 100分求
- 如何检测程序的主跳转是否已被修改?猛Q、伴水、Ari、哈欠...等牛人,希望进来解释一下 -_-!
- 如何给 treeview的节点设置上网址连接,点击后,跳到一个网站上??
- 在线等候!
- 100元人民币 求idhttp上传文件idhttpserver接收
- 关于异常处理问题,不知如何得到 E…….ErrorCount(错误号)
- 关于execl文件导入数据库问题!
- 如何解决IdHTTP访问网页时本机COOKIES无法生成?
- 调用自定义函数老提示如下错误
AChar: WideChar // 单个汉字
): Char; // 返回单个汉字的拼音简码
begin
if (AChar >= '啊') and (AChar <= '澳') then
Result := 'A'
else if (AChar >= '芭') and (AChar <= '怖') then
Result := 'B'
else if (AChar >= '擦') and (AChar <= '搭') then
Result := 'C'
else if (AChar >= '达') and (AChar <= '堕') then
Result := 'D'
else if (AChar >= '蛾') and (AChar <= '贰') then
Result := 'E'
else if (AChar >= '发') and (AChar <= '咐') then
Result := 'F'
else if (AChar >= '噶') and (AChar <= '过') then
Result := 'G'
else if (AChar >= '哈') and (AChar <= '祸') then
Result := 'H'
else if (AChar >= '击') and (AChar <= '骏') then
Result := 'J'
else if (AChar >= '喀') and (AChar <= '阔') then
Result := 'K'
else if (AChar >= '垃') and (AChar <= '络') then
Result := 'L'
else if (AChar >= '妈') and (AChar <= '穆') then
Result := 'M'
else if (AChar >= '拿') and (AChar <= '诺') then
Result := 'N'
else if (AChar >= '哦') and (AChar <= '沤') then
Result := 'O'
else if (AChar >= '啪') and (AChar <= '瀑') then
Result := 'P'
else if (AChar >= '期') and (AChar <= '群') then
Result := 'Q'
else if (AChar >= '然') and (AChar <= '弱') then
Result := 'R'
else if (AChar >= '撒') and (AChar <= '所') then
Result := 'S'
else if (AChar >= '塌') and (AChar <= '唾') then
Result := 'T'
else if (AChar >= '挖') and (AChar <= '误') then
Result := 'W'
else if (AChar >= '牺') and (AChar <= '迅') then
Result := 'X'
else if (AChar >= '压') and (AChar <= '孕') then
Result := 'Y'
else if (AChar >= '匝') and (AChar <= '座') then
Result := 'Y'
else Result := '_';
end; { CharToShort }function StringToShort( // 得到字符串的拼音简码
AString: WideString // 字符串
): string; // 返回拼音简码,如果是字母则不改变
var
I: Integer;
begin
Result := '';
for I := 1 to Length(AString) do
if AString[I] > #255 then
Result := Result + CharToShort(AString[I])
else Result := Result + UpperCase(AString[I]);
end; { StringToShort }
如果你没事的话可以给我发邮件
我给你传过去!~
[email protected]