, , , , , ( ). , , , . , , .
Dim fntNormal As New Font(myFontFamily, myFontSize, FontStyle.Regular, GraphicsUnit.Pixel)
Dim fntUnderline As New Font(myFontFamily, myFontSize, FontStyle.Underline, GraphicsUnit.Pixel)
g.DrawString("This is ", fntNormal, Brushes.Black, rctTextArea)
w1 = g.MeasureString("This is ", fntNormal).Width
w2 = g.MeasureString("underlined", fntUnderline).Width
If w1 + w2 > rctTextArea.Width Then
yPos = rctTextArea.Y + g.MeasureString("This is ", fntNormal).Height + 5
xPos = rctTextArea.X
Else
yPos = rctTextArea.Y
xPos = 0
End If
g.DrawString("underlined", fntUnderline, Brushes.Black, xPos, yPos)
w1 = g.MeasureString("underlined", fntUnderline).Width
w2 = g.MeasureString(", and this is not.", fntNormal).Width
If w1 + w2 > rctTextArea.Width Then
yPos += g.MeasureString("underlined", fntUnderline).Height + 5
xPos = rctTextArea.X
Else
xPos = 0
End If
g.DrawString(", and this is not.", fntNormal, Brushes.Black, xPos, yPos)
, .
.
VB, , #.