Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8198737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:00:53+00:00 2026-06-07T06:00:53+00:00

I need to draw a string over a Infragistics toolbar, and I cannot use

  • 0

I need to draw a string over a Infragistics toolbar, and I cannot use a label since it’s background will not be actually transparent (see in image).

I’ve managed to overlay the text as desired using DrawString method, but the problem is that the text does not resemble a label. it’s thicker, aliased and for some reason black.

What should i change im my code to replicate a label’s looks using the DrawString method (same font, size, forecolor) ?

enter image description here

And the code:

FontFamily fontFamily = new FontFamily("Microsoft Sans Serif");
                Font font = new Font(
                   fontFamily,
                   17,
                   FontStyle.Regular,
                   GraphicsUnit.Pixel);
                SolidBrush solidBrush = new SolidBrush(SystemColors.ControlText);

                drawParams.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
                drawParams.Graphics.DrawString("String Drawn with DrawString method", font, solidBrush, textEditorLoc.X, textEditorLoc.Y + 25);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:00:54+00:00Added an answer on June 7, 2026 at 6:00 am

    Try using TextRenderer class:

    TextRenderer.DrawString(
        drawParams.Graphics,
        "String Drawn with TextRenderer (GDI) method",
        font,
        new Point(textEditorLoc.X, textEditorLoc.Y + 25),
        SystemColors.ControlText);
    

    Also leave TextRenderingHint as SystemDefault and use the same font size as for label.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use core text to draw string that can span over 100
I need to draw 2D overlay over OpenGL scene. OpenGL is used for 2D
Since I've tried to draw string with every combination of smoothing and rendering with
Whats going on is i need to draw a black rectangle over the image.
Possible Duplicate: How to use glyph from Apple Symbols font? I need to draw
i need some help to print a string over a opengl 3d scene. I
I need to draw a rectange,circle and line and then animate them(press left ->
I need to draw vertical and horizontal rectangle / bands (like in Gantt charts)
I need to draw simple alpha maps in xna which depends on current game
I need to draw a chart to show the evolution of data in real

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.