CListBox head language display problem
-
Hi. When I try to display chinese or other characters in the column of the CListBox, it comes out jibberish. ENglish is fine. Can someone enlighten me why this is the case and how to allow other languages to work in the Clistbox? Thanks in advance. Stan the man
-
Hi. When I try to display chinese or other characters in the column of the CListBox, it comes out jibberish. ENglish is fine. Can someone enlighten me why this is the case and how to allow other languages to work in the Clistbox? Thanks in advance. Stan the man
Did you install china fonts on your system?
-
Did you install china fonts on your system?
I can display correctly everything on buttons and static items. Only the ListBox seems to have this problem. Am not quite sure what is different between this and the other things. THanks. Stan the man
-
I can display correctly everything on buttons and static items. Only the ListBox seems to have this problem. Am not quite sure what is different between this and the other things. THanks. Stan the man
Stan the man wrote:
Only the ListBox seems to have this problem
May be it is because the current font in the list box dosent suport unicode. try setting some other fonts to it such as "Arial Unicode MS"
nave [OpenedFileFinder]
-
Hi. When I try to display chinese or other characters in the column of the CListBox, it comes out jibberish. ENglish is fine. Can someone enlighten me why this is the case and how to allow other languages to work in the Clistbox? Thanks in advance. Stan the man
You have to set the correct character set. Try this in your "OnInitDialog()":
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfCharSet = CHINESEBIG5_CHARSET; //or GB2312_CHARSET
strcpy(lf.lfFaceName, "System"); //you can try other fonts but they have to support the language
m_font.CreateFontIndirect(&lf);
GetDlgItem(IDC_LIST)->SetFont(&m_font);where "m_font" is a CFont member variable and IDC_LIST is your CListBox ID.
-
You have to set the correct character set. Try this in your "OnInitDialog()":
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfCharSet = CHINESEBIG5_CHARSET; //or GB2312_CHARSET
strcpy(lf.lfFaceName, "System"); //you can try other fonts but they have to support the language
m_font.CreateFontIndirect(&lf);
GetDlgItem(IDC_LIST)->SetFont(&m_font);where "m_font" is a CFont member variable and IDC_LIST is your CListBox ID.
THank you everyone. That was the problem. Appreciate the help.