Skip to content
1 change: 1 addition & 0 deletions docs/visual-basic/language-reference/xmldoc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The Visual Basic compiler can process documentation comments in your code to an
- [\<seealso>](seealso.md) <sup>1</sup>
- [\<summary>](summary.md)
- [\<typeparam>](typeparam.md) <sup>1</sup>
- [\<typeparamref>](typeparamref.md)
- [\<value>](value.md)

(<sup>1</sup> The compiler verifies syntax.)
Expand Down
39 changes: 39 additions & 0 deletions docs/visual-basic/language-reference/xmldoc/typeparamref.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
description: "Learn more about: <typeparamref> (Visual Basic)"
title: "<typeparamref>"
ms.date: 07/20/2015
helpviewer_keywords:
- "typeparamref XML tag"
- "<typeparamref> XML tag"
ms.assetid: 8979d53b-beb1-41b7-b41e-6bbea1c17a03
---
# \<typeparamref> (Visual Basic)

Formats a word as a type parameter.

## Syntax

```xml
<typeparamref name="name"/>
```

## Parameters

`name`
The name of the type parameter to refer to. Enclose the name in double quotation marks (" ").

## Remarks

The `<typeparamref>` 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 `<typeparamref>` tag to refer to the `T` type parameter.

[!code-vb[VbVbcnXmlDocComments#9](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnXmlDocComments/VB/Class1.vb#9)]

## See also

- [XML Comment Tags](index.md)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Option Explicit On
Option Strict On

Expand Down Expand Up @@ -168,6 +168,20 @@
' Code goes here.
End Sub
' </snippet7>

' <typeparamref>
' <snippet9>
''' <summary>
''' Compares two items of type <typeparamref name="T"/>.
''' </summary>
''' <typeparam name="T">The type of items to compare.</typeparam>
''' <param name="item1">The first item of type <typeparamref name="T"/>.</param>
''' <param name="item2">The second item of type <typeparamref name="T"/>.</param>
''' <returns>True if the items are equal, False otherwise.</returns>
Public Function CompareItems(Of T As IComparable)(ByVal item1 As T, ByVal item2 As T) As Boolean
Return item1.CompareTo(item2) = 0
End Function
' </snippet9>
End Class

' <code> 925e5342-be05-45f2-bf66-7398bbd6710e.xml
Expand Down
Loading