TComboBox---Text值----字符串翻转问题(急)

wanjianjun 2009-08-31 11:18:18
在TComboBox的Onchange事件中,获取TComboBox的Text值是反显得。
比如:你输入“中国”,在Onchange中截取Text值为“中国”,
因为我必须要在Onchange事件中把Text值传出去。如何解决?

...全文
170 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
wanjianjun 2009-09-01
  • 打赏
  • 举报
回复
没有人晓得了吗?
wanjianjun 2009-09-01
  • 打赏
  • 举报
回复
麻烦回复的时候测试了再回复,xjq2003的代码不行。。。。。。。
wanjianjun 2009-09-01
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 hxy3100 的回复:]
你用的是什么版本的delphi啊,我用7.0怎么显示的就是中国呢?
[/Quote]

我的是D7,不可能的哦,要弄清楚哦, 是在TComboBox的Onchange事件中写:
showmessage(TComboBox.text)哦,然后你在输入2个字以上的文字,show出来的文字就是反显的。
hxy3100 2009-09-01
  • 打赏
  • 举报
回复
你用的是什么版本的delphi啊,我用7.0怎么显示的就是中国呢?
wanjianjun 2009-09-01
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 zzflover 的回复:]
你代码怎么写的,发出来看看。
[/Quote]

我晕都晕了,这还用发出来看吗?
就是在TComboBox的Onchange事件中,获取Text值啊
你showmessage()出来看嘛。
7年 2009-09-01
  • 打赏
  • 举报
回复
你代码怎么写的,发出来看看。
wanjianjun 2009-09-01
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 zxf_feng 的回复:]
引用楼主 wanjianjun 的回复:
在TComboBox的Onchange事件中,获取TComboBox的Text值是反显得。
比如:你输入“中国”,在Onchange中截取Text值为“国中”,
因为我必须要在Onchange事件中把Text值传出去。如何解决?



在onchange中把信息传到哪里?在onenter事件中不可以吗
[/Quote]


我必须要在改变记录的时候触发呀,必须在Onchange中取。。。。。
像TEdit的text就是正常的。
haitao 2009-09-01
  • 打赏
  • 举报
回复
[Quote=引用楼主 wanjianjun 的回复:]
在TComboBox的Onchange事件中,获取TComboBox的Text值是反显得。
比如:你输入“中国”,在Onchange中截取Text值为“中国”,
因为我必须要在Onchange事件中把Text值传出去。如何解决?
[/Quote]

要么:多于1个字符或汉字的,再反一次
要么:记住上次onchange时combobx.text的值,本次事件时combobx.text的值与上次做比较
阿三 2009-09-01
  • 打赏
  • 举报
回复
[Quote=引用楼主 wanjianjun 的回复:]
在TComboBox的Onchange事件中,获取TComboBox的Text值是反显得。
比如:你输入“中国”,在Onchange中截取Text值为“中国”,
因为我必须要在Onchange事件中把Text值传出去。如何解决?


[/Quote]
在onchange中把信息传到哪里?在onenter事件中不可以吗
wanjianjun 2009-09-01
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 bdmh 的回复:]
没看明白你的问题,反显是什么意思,你要达到什么目的
比如:你输入“中国”,在Onchange中截取Text值为“中国”, 这句话说明了什么,都是'中国'
[/Quote]

不好意思,是我打错了,在Onchange中截取Text值是反的,为:“国中”了,
我要的结果是正常的现实结果“中国”。
bdmh 2009-09-01
  • 打赏
  • 举报
回复
没看明白你的问题,反显是什么意思,你要达到什么目的
比如:你输入“中国”,在Onchange中截取Text值为“中国”, 这句话说明了什么,都是'中国'
wanjianjun 2009-09-01
  • 打赏
  • 举报
回复
就没人有一个满意的答案?
结贴算了。
wanjianjun 2009-09-01
  • 打赏
  • 举报
回复
CSDN里的高手些呢,都潜水了迈。。。。
wanjianjun 2009-09-01
  • 打赏
  • 举报
回复
[Quote=引用 16 楼 bdmh 的回复:]
不是没人能理解你的意思,好像是你没理解大家的意思了,14楼已经解释了原因
[/Quote]


解决了好了哟,请你好好看看我的提问。
goalone1985 2009-09-01
  • 打赏
  • 举报
回复
试过了 EDIT 是可以。。
呵呵 不知道了 如果是源代码的问题。也不好解决。
换种思路解决你的方案吧
bdmh 2009-09-01
  • 打赏
  • 举报
回复
不是没人能理解你的意思,好像是你没理解大家的意思了,14楼已经解释了原因
wanjianjun 2009-09-01
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 goalone1985 的回复:]
我明白你的意思了。。。你估计是程序运行时。用拼音输入法打的中国 然后按空格或者enter显示国中
  这个不是onchange事件 反转的问题
  combobox.text的内容也反转了。。
这个估计和系统 拼音转换汉字,delphi输入捕捉有关
  是说。当你按下空格或者enter键盘时候。combobox捕捉你的输入同时拼音转换为汉字。。估计是因为拼音转换汉字时候从最后一个开始识别并转换。把输入顺序重值了。。
  建议不要用onchange事件 传出数据。。刚输入就触发这个时间了。比如你想传递 'change'这个字符,结果只能传递 'c'一个字符而也


 

[/Quote]



哎呀,就没人能真正理解我说的意思,跟捕捉一点关系都没有,这是VCL源代码的问题,在TEDIT的onchange事件中获取text值是没有问题的。
goalone1985 2009-09-01
  • 打赏
  • 举报
回复
我明白你的意思了。。。你估计是程序运行时。用拼音输入法打的中国 然后按空格或者enter显示国中
这个不是onchange事件 反转的问题
combobox.text的内容也反转了。。
这个估计和系统 拼音转换汉字,delphi输入捕捉有关
是说。当你按下空格或者enter键盘时候。combobox捕捉你的输入同时拼音转换为汉字。。估计是因为拼音转换汉字时候从最后一个开始识别并转换。把输入顺序重值了。。
建议不要用onchange事件 传出数据。。刚输入就触发这个时间了。比如你想传递 'change'这个字符,结果只能传递 'c'一个字符而也



wanjianjun 2009-08-31
  • 打赏
  • 举报
回复
要的是delphi代码,不是c++
xjq2003 2009-08-31
  • 打赏
  • 举报
回复
char buf[],buf2[];
String ss=comboBox->text;
strcpy(buf,ss.c_str());
int j=0;
for(int i=ss.lenth();i>0;i--)
{
buf2[j++]=buf[i];
}

ss=String(buf2);
3rd-party components For support in the project, a required 3rd-party controls must be declared in the SkinManager.ThirdParty property. Use a special design-time editor for handy adding of required controls. -------------------------------------------------------------------------------- List of supported components : - Standard VCL (TPanel, TEdit, TMemo, TListBox, TComboBox, TMaskEdit, TStringGrid, TDrawGrid, TCheckListBox, TRichEdit, THotKey, TTreeView, TListView, TDBGrid, TDBEdit, TDBMemo, TDBListBox, TDBLookupListBox, TDBRichEdit, TGroupBox, TButton, TCheckBox, TRadioButton and others) - Windows system dialogs (File open/save, Font dialog, Color dialog and others) - DevExpress grids and other controls which supports LookAndFeel technology - RXLib (TCurrencyEdit, TTextListBox, TRxRichEdit, TRxDrawGrid, TRxDBGrid, TRxDBLookupList, TRxDBRichEdit and others) - JVCL (JvValidateEdit, JvEdit, JvMemo, JvRichEdit and others) - EhLib controls - TPNGImageList - TntControls Unicode - Most TMS edits and grids - Billenium effects - TSynEdit, TSynMemo, TDBSynEdit - Virtual Controls (TVirtualStringTree and TVirtualDrawTree) - most Woll2Woll InfoPower 4000 controls - TmxFlatEdit, TmxFlatFloatEdit, TmxFlatMaskEdit, TmxFlatMemo, TmxFlatRichEdit, TmxFlatListBox, TmxFlatDirectoryListBox, TmxFlatFileListBox, mxFlatCheckListBox and others - ImageEn library - TRichView, TRichViewEdit, TDBRichViewEdit and TDBRichView - TVirtualExplorerListView, TVirtualExplorerTreeview - Raize controls (TRzPanel, TRzGroupBox, TRzEdit, TRzMaskEdit, TRzNumericEdit, TRzExpandEdit, TRzHotKeyEdit, TRzTreeView, TRzCheckTree, TRzMemo, TRzRichEdit, TRzShellTree, TRzShellList, TRzRankListBox, TRzListBox, TRzTabbedListBox, TRzCheckList, TRzEditListBox, TRzComboBox, TRzImageComboBox, TRzMRUComboBox, TRzShellCombo, TRzLabel, TRzURLLabel, TRzDateTimeEdit) - TWebBrowser -------------------------------------------------------------------------------- Some instructions for 3rd-party features using in the AlphaControls full release : 1. Most standard and 3rd-party controls Skinned automatically if required controls are declared in the SkinManager.ThirdParty property and SkinManager.SkinningRules.srThirdParty property is true 2. TntControls Unicode Most controls from AlphaControls package may have support of Unicode (in Delphi6-2009). In this case used the TntControls package (thanks TNT authors, TntControls must be installed already). For using this feature should be uncommented the TNTUNICODE key in the sDefs.inc file (should be {$DEFINE TNTUNICODE}) and AlphaControls package must be reinstalled (sources needed). Note : don't forget backup all projects before opening after package installation, some Unicode data may be lost if compiled without TNTUNICODE key. 3. TPngImageList Since version 6 AlphaControls have native support of PNG format (TsAlphaImageList was added also). Buttons and menus from AlphaControls have support of TPngImageList component also. For work with this component the USEPNG key should be defined in the sDefs.inc file (must be {$DEFINE USEPNG}). TPNGImageList is a freeware component with sources that may be used for work with PNG glyphs in any application. May be downloaded from http://www.thany.org/article/32/PngComponents 4. DevExpress grids and other controls - Install DevExpress and AlphaControls - Enable the 'DEVEX6' or 'DEVEX2011' key in the sDefs.inc file (AlphaControls), must be {$DEFINE DEVEX6} - Be sure that latest version of DevExpress is installed, or check a list of supported DevExpress versions in the beginning of the acLFPainter.pas file (AlphaControls) - Configure the sSkinManager component and compile the project. In the run-time will be skinned all DevExpress controls which have LookAndFeel property properly supported. LookAndFeel.NativeStyle property must be False. 'DEVEX' key must be enabled (in the sDefs.inc file) before AlphaControls installing (must be {$DEFINE DEVEX}). 5. Billenium Effects This package is supported authomatically 6. TWebBrowser The ADDWEBBROWSER key should be enabled in the sDefs.inc file before a package installing. Sources of the package are required. TWebBrowser type should be added in sSkinManager1.ThirdParty list as 'WebBrowser'

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧