diff --git a/docs/visual-basic/language-reference/xmldoc/index.md b/docs/visual-basic/language-reference/xmldoc/index.md index a5d42e130cf2d..b574812f86f04 100644 --- a/docs/visual-basic/language-reference/xmldoc/index.md +++ b/docs/visual-basic/language-reference/xmldoc/index.md @@ -37,6 +37,7 @@ The Visual Basic compiler can process documentation comments in your code to an - [\](seealso.md) 1 - [\](summary.md) - [\](typeparam.md) 1 +- [\](typeparamref.md) - [\](value.md) (1 The compiler verifies syntax.) diff --git a/docs/visual-basic/language-reference/xmldoc/typeparamref.md b/docs/visual-basic/language-reference/xmldoc/typeparamref.md new file mode 100644 index 0000000000000..a85dae50fe407 --- /dev/null +++ b/docs/visual-basic/language-reference/xmldoc/typeparamref.md @@ -0,0 +1,38 @@ +--- +description: "Learn more about: (Visual Basic)" +title: "" +ms.date: 09/10/2025 +helpviewer_keywords: + - "typeparamref XML tag" + - " XML tag" +ai-usage: ai-assisted +--- +# \ (Visual Basic) + +Formats a word as a type parameter. + +## Syntax + +```xml + +``` + +## Parameters + + `name`: The name of the type parameter to refer to. Enclose the name in double quotation marks (" "). + +## Remarks + + The `` tag gives you a way to indicate that a word is a type parameter. The XML file can be processed to format this type parameter in some distinct way, for example in italics. + + Compile with [-doc](../../reference/command-line-compiler/doc.md) to process documentation comments to a file. + +## Example + +This example uses the `` tag to refer to the `T` type parameter. + +:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnXmlDocComments/VB/Class1.vb" id="snippet9"::: + +## See also + +- [XML Comment Tags](index.md) diff --git a/docs/visual-basic/toc.yml b/docs/visual-basic/toc.yml index 0e749ebb57c55..0aa0aa2e05b2d 100644 --- a/docs/visual-basic/toc.yml +++ b/docs/visual-basic/toc.yml @@ -852,6 +852,8 @@ items: href: language-reference/xmldoc/summary.md - name: href: language-reference/xmldoc/typeparam.md + - name: + href: language-reference/xmldoc/typeparamref.md - name: href: language-reference/xmldoc/value.md - name: XML Axis Properties diff --git a/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnXmlDocComments/VB/Class1.vb b/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnXmlDocComments/VB/Class1.vb index 70e2023aee777..c3ab51f528676 100644 --- a/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnXmlDocComments/VB/Class1.vb +++ b/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnXmlDocComments/VB/Class1.vb @@ -168,6 +168,20 @@ Public Class Test ' Code goes here. End Sub ' + + ' + ' + ''' + ''' Compares two items of type . + ''' + ''' The type of items to compare. + ''' The first item of type . + ''' The second item of type . + ''' True if the items are equal, False otherwise. + Public Function CompareItems(Of T As IComparable)(ByVal item1 As T, ByVal item2 As T) As Boolean + Return item1.CompareTo(item2) = 0 + End Function + ' End Class ' 925e5342-be05-45f2-bf66-7398bbd6710e.xml diff --git a/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnXmlDocComments/VB/VbVbcnXmlDocComments.vbproj b/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnXmlDocComments/VB/VbVbcnXmlDocComments.vbproj new file mode 100644 index 0000000000000..6c01204549952 --- /dev/null +++ b/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnXmlDocComments/VB/VbVbcnXmlDocComments.vbproj @@ -0,0 +1,9 @@ + + + + net9.0 + VbVbcnXmlDocComments + true + + + \ No newline at end of file