I would like to put the number on the left edge of the menu item in vb.net 2010, but it seems that this can only be set on the image. So, I am trying to create an image with the number I want there using Graphics.DrawString(). I tried different ways, but I can not make the resulting image look like text in the menu item itself - is there a way to do this? Here's my current code (highlighting an image to measure text, and then redistributing to the correct size around version 3 of this is pretty ugly, but I'm not sure how to measure it yet).
mnuItem = New ToolStripMenuItem
numPeople = CInt(Math.Ceiling(Rnd() * 20))
' Calculate the size of the text
qImg = New Bitmap(1, 1)
sf.Alignment = StringAlignment.Center
sf.LineAlignment = StringAlignment.Center
gr = Graphics.FromImage(qImg)
gr.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
sz = gr.MeasureString(numPeople, mnuItem.Font, New Point(0, 0), sf)
w = CInt(Math.Ceiling(sz.Width))
h = CInt(Math.Ceiling(sz.Height))
m = Math.Max(w, h)
' Now allocate an image of the correct size
qImg = New Bitmap(m, m)
gr = Graphics.FromImage(qImg)
gr.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
gr.DrawString(numPeople, mnuItem.Font, Brushes.Black, New RectangleF((m - w) / 2, (m - h) / 2, w, h), sf)
mnuItem.Image = qImg
Here are some examples of what this gives - note how the fuzzy text of the field (image) compares with the text of the menu item:


TextRenderingHint, , . ?