Simple solution: make a label with the text and set its location to the radio
left + radio width + some padding.
Trickey solution: Calculate the image width and pad spaces to the radio text:
Dim g As Graphics = RadioButton1.CreateGraphics()
Dim ImageWidth As Integer = RadioButton1.Image.Width
Dim PadText As String = " "
Dim i As Integer = 0
While (True)
If g.MeasureString(PadText, RadioButton1.Font).Width * i >
ImageWidth Then Exit While
i += 1
RadioButton1.Text = PadText + RadioButton1.Text
End While
Maybe it won't work well with some fonts.
"Samuel R. Neff" wrote:
I have a set of radio buttons in a win form that each have an image
and text, like so:
O [image] [label]
O [image] [label]
O [image] [label]
O [image] [label]
How can I set it up so that the image is left aligned, next to the
radio button indicator, and the text is left aligned next to the
image?
I don't see any way to align the text so that it's aware of the image.
Thanks,
Sam