NewLine in "Description" Attribute?
How can I include a newLine char in 开发者_如何学Cthe System.ComponentModel.Description
atribute?
<System.ComponentModel.Description("Specifies the precision of decimal numbers\n(min 2 for Currency and Percent; 20 for Decimal)")> _
Public Property Precision() As Integer
If you use basically the same code in C#, it will at least have the newline character in the attribute value:
[Description("Specifies the precision of decimal numbers\n etc"]
public int Precision { ... }
Now how Visual Studio handles that is a different matter. You may want to try \r\n
instead of just \n
.
I suspect the reason you're currently seeing \n
in the designer at the moment is that VB doesn't escape strings in the same way. In VB you could try using vbCrLf
(the equivalent of \r\n
):
<Description("Specifies the precision of decimal numbers" & vbCrLf & "...")>
It would seem that you already have. The issue, perhaps, is getting whatever you are using (I'm guessing PropertyGrid
?) to render the return. That is outside your control. You might also try using crlf, \r\n
, but no guarantees there either.
I haven't had success with using \n or \r\n. Instead, I have had to use the HTML tag of </br>
to get a line-break.
精彩评论