Hello Experts.
I have a small form based application. which displays unicode chars, this program works fine on windows 7. but fails on windows XP.
for testing i have created a simple program,
this program has a unicode text,
In the On Paint event the text is displayed properly.
(On Win 7 = displayed Properly, On XP = Displayed Properly)
but if the same string displayed on a Button's caption it's characters are displayed as blank rectangles.
(On Win 7 = displayed Properly, On XP = blank rectangles).
in windows 7 there is no problem, but if i run this program under windows XP, then
on button's caption string is displayed as blank rectangles.
am i missing something.
pl. suggest.
-prateek.
here is the code.
public partial class TestForm : Form
{
string m_strText;
public TestForm()
{
InitializeComponent();
}
private void TestForm_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawString ( m_strText,
new Font ( this.Font.FontFamily, 20 ),
new SolidBrush ( Color.Blue),
10, 10 ) ;
}
private void TestForm_Load(object sender, EventArgs e)
{
char [] szBuf = new char [] { (char)0x915, (char)0x916,
(char)0x917, (char)0x918 } ;
int nCnt = szBuf .Length;
for (int nC = 0; nC < szBuf.Length; nC++)
m_strText += szBuf[nC];
}
private void btnGet_Click(object sender, EventArgs e)
{
btnGet.Text = m_strText;
this.Text = m_strText;
}
}