Dim text As String
FontDialog.ShowColor = True
If FontDialog.ShowDialog() = DialogResult.OK Then
text = "<font style='font-size:" + FontDialog.Font.Size.ToString + "px;' face='" + FontDialog.Font.FontFamily.Name + "' color='" + FontDialog.Color.ToKnownColor.ToString + "'>" + codebox.SelectedText + "</font>"
If FontDialog.Font.Underline = True Then
text = "<u>" + text + "</u>"
End If
If FontDialog.Font.Italic = True Then
text = "<i>" + text + "</i>"
End If
If FontDialog.Font.Bold = True Then
text = "<strong>" + text + "</strong>"
End If
If FontDialog.Font.Strikeout = True Then
text = "<s>" + text + "</s>"
End If
codebox.SelectedText = text
End If