On application startup, you can globally set this on all controls with:
Application.SetCompatibleTextRenderingDefault(False)This draws all the labels in the system much clearer than previous versions especially when using the Tahoma 8.25pt font. When using this font at design time and dragging fields from your datasources window, the labels will line up using the new 2.0 behavior, but if you forget to set this at runtime using the above code, you may notice your labels not lining up properly.
If drawing strings manually, like from paint handlers on controls, you'll want to use the new TextRenderer.
So instead of:
Graphics.DrawString(someText, Me.Font, New SolidBrush(Me.ForeColor), rect)Use this code instead:
TextRenderer.DrawText(Graphics, someText, Me.Font, rect, Me.ForeColor, TextFormatFlags.Left)
1 comment:
This is usefull information..
Post a Comment