c# - Understanding OnPaint method -


I am working on some project witch, there are lots of labels I have an act to make the label smoother because It looks ugly, I've written my custom LabelEx class which increases the Label class. Then I overpric () method like this:

  protected override zero OnPaint (PaintEventArgs e) {base.OnPaint (e); E.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias; }  

But this does not work. I still have my old ugly labels

OnPaint help me understand the meaning of the method how does it work? I want my labels to get the properties that I set them in myClass.cs [Design] (location, size, textlines, font). I just need to make them smoother.

This is what I & quot; ugly & quot; By default label OnPaint is used by GDI (System.Windows.Forms.TextRenderer);

  Public class LabelEx: System.Windows.Forms.Label {Public LabelEx () {UseCompatibleTextRendering = true; } Safe Override Zero OnPaint (PaintEventArgs e) {eGraphics.TextRenderingHint = TextRenderingHint.AntiAlias; // You can also try these two options //e.Graphics.CompositingQuality = CompositingQuality.HighQuality; //e.Graphics.InterpolationMode = Interpolation mode. Highquite bibbic; Base.OnPaint (E); }}  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -