Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Embedded font puzzler
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01523380
Message ID:
01523708
Vues:
35
>Hi,
>If true that would be extremely weird !
>Did someone actually suggest this as a solution ?
>
>>Hi Viv, just to update you on the font problem , adding the line below to the MDIClient OnPaint event seems to have cured the problem
>>
>>
>>void ClientControl_Paint(object sender,PaintEventArgs e)
>>{
>>    e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
>>    // draw your stuff here
>>}
>>
>>
No it wasn't suggested but I noticed in the form that always worked first time - this line was present so in desperation I added it - I can't for the life of me think why this should make a difference but I've tested it to death and it does. As I said in an earlier post the font was 'magically' copied to the Windows\Font folder , so I deleted the font file and ran the form without the *new* line of code and sure enough the problem returned, I then repeated the process ( with the *new* line ) and voila ! it worked perfectly. WEIRD !!!. Don't know if this pertinent , but the form that *always* worked is a normal Winform whilst the other is an MDIContainer and you do have to jump through hoops to draw on it, firstly you have to get a reference to the MdiClient like this:
// In the forms load event
foreach(Control c in this.Controls)
{
  if(c is MdiClient)
        {
        this.ClientControl = c; \\ ClientControl is a field in my form class.
        this.ClientControl.Paint+= MyPaintMethod;
        break;
        }
}
I don't understand the difference though :-(
Regards,
Peter J. Kane



Pete
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform