funny working ListBox - help!

From: jagello (jagello7_at_hotmail.com)
Date: 05/30/04


Date: 30 May 2004 07:50:54 -0700

Hi!

I have a problem with setting the character set in my ListBox (List).
When I create a CFont object with a specific character set and I set
that font in the Device Context recieved from the ListBox, then it is
OK. I can write through that DC in the chosen charset. See Code :

    CFont * font = new CFont;
    CFont *oldFont;
    CPaintDC dc( List );
    font->CreateFont (28,0,0,0,700,0,0,0,
        RUSSIAN_CHARSET,OUT_DEFAULT_PRECIS,
        CLIP_DEFAULT_PRECIS,
        DEFAULT_QUALITY,
        DEFAULT_PITCH|FF_DONTCARE,
            "Arial");
        oldFont = dc.SelectObject( font);
        dc.ExtTextOut(10,170,0,
                NULL,"some text",
                strlen("some text"),NULL);

!!!!!!!!! BUT !!!!!!!!!
If I set that font right in my ListBox and want to have the text added
with code :

        List->SetFont( font, TRUE);
        List->AddString( "some other text" );

in the chosen charset, then it DOES NOT work !
However the added text has the other parameters of the chosen font (
Height and so on) but the charset is the original (standard) one.
Does anyone know how to force the ListBox to accept the charset from
the font also ?
Please HELP !



Relevant Pages

  • Re: funny working ListBox or a bug in VS 6.0 ?
    ... > I have a problem with setting the character set in my ListBox. ... > in the chosen charset, ... In the above you do a 'new CFont'. ...
    (microsoft.public.vc.mfc)
  • Re: funny working ListBox or a bug in VS 6.0 ?
    ... >If I set that font right in my ListBox and want to have the text added with code: ... >in the chosen charset, ... variable of the dialog that uses the listbox control. ... Dave ...
    (microsoft.public.dotnet.languages.vc)
  • Foreign Language - support & fonts
    ... I'm working on a website that is being translated into several languages. ... A few translators, who are working in ... for their particular character set, and I have ... using the "Kruti Dev 021" font, ...
    (microsoft.public.windowsxp.newusers)
  • Re: Owner drawn listbox
    ... Pass a reference of the listbox to the ... OwnerDrawListBox object, and use the objects Add method for adding items to ... ' Currently if a row is 'special', then the current font is ... Public Sub Add ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Lebans Tooltip Control : Listbox font size
    ... time when calculating the font height for a row in the ListBox. ... you can turn off the column header Tooltip by NOT enabling Column ...
    (microsoft.public.access.forms)