Prithis
Prithis

Reputation: 1033

Use more than one font to drawstring

I want to use drawString to print a sentance but some parts of it has to be bold. What is the best way to do this? Yes, I have considered using two drawString. But is there a intelligent way of using two drawStrings if we have to.

We cannot make any assumtion about the length of the sentance. However it is prepared in a format.

eg:

Say hello to name. Good afternoon name.

Thanks

Upvotes: 2

Views: 180

Answers (2)

Leo Vo
Leo Vo

Reputation: 10330

This is my old question on MSDN & it was answered. It works good. I hope it is the thing you want to find. http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/8a050039-d74a-4ab5-9237-98615e10e303

Upvotes: 1

Oded
Oded

Reputation: 499402

Yes, you will have to call DrawString twice - you can write a small wrapper class (or extension method) that will do that for you.

Upvotes: 0

Related Questions