delphi下teeChart显示中文的怪问题解决

teeChart是delphi下最强的图表控件,这几年也已经发展到了dotnet等环境下。teeChart在8.0版本中提供了简单的使界面中文化显示的功能,你只要在FormCreate事件中加入TeeSetChineseSimp;就可以了。

但是在实际使用中碰到一个怪问题,就是当程序运行后,第一次显示的使用teechart的窗口不能正常中文化,而第二次显示及以后就可以了。程序中包含teechart的窗口是每次需要的时候动态生成的。

我现在用这样的方法来解决,在主窗口生成的时候,先创建一次包含teechart的窗口,骗一下,之后程序内的调用就都是第二次之后了。当然要用show,这样才能马上关掉。

try
    frmChart := TfrmChart.Create(Application);
    frmChart.Show;
    frmChart.Close;
 finally
    frmChart.Free;
 end;

相关内容

This entry was posted in delphi and tagged , , . Bookmark the permalink.

One Response to delphi下teeChart显示中文的怪问题解决

  1. wingfish says:

    后来网上查到可以通过在dpr项目源文件中加入TeeSetChineseSimp就可以了,这样不需要生成两次窗口。

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">