# CommentCollection Class

> Contains all comments in the main text or another part of a document. All comments are associated with a certain piece of text of the document. The collection consists of CommentedText objects, describing the position and length of the commented text and the comment string itself. A collection object can be obtained with the TextControl.Comments, the HeaderFooter.Comments or the TextFrame.Comments property. The CommentCollection class implements the IEnumerable and the ICollection interfaces.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 30.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Implements:** `System.Collections.ICollection`, `System.Collections.IEnumerable`
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > CommentCollection Class
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/#description)
- [Syntax](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/#syntax)
- [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/#examples)
- [Members](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/#members)

---

## In This Section

- [CommentCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/add-method/llms.txt): Adds a new comment to the document.
- [CommentCollection.AddResult Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/addresult-enumeration/llms.txt): Specifies the result when a comment has been added to the document.
- [CommentCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/copyto-method/llms.txt): Copies the elements of the collection to an array, starting at a particular index.
- [CommentCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/count-property/llms.txt): Gets the number of elements contained in the collection.
- [CommentCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/getenumerator-method/llms.txt): Returns an enumerator that can be used to iterate through the collection.
- [CommentCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/getitem-method/llms.txt): Gets a particular item from the collection.
- [CommentCollection.IsSynchronized Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/issynchronized-property/llms.txt): Returns true if the collection is designed to be thread safe, otherwise, it returns false.
- [CommentCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/item-property/llms.txt): Gets the comment with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the CommentCollection class.
- [CommentCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/remove-method/llms.txt): Removes a CommentedText from the collection. The method removes the saved position values and the comment string. The text, which is commented, is not removed from the document.
- [CommentCollection.SyncRoot Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/syncroot-property/llms.txt): Gets an object that can be used to synchronize access to the collection.

---

## Nearby

- **Previous:** [ClipboardFormat Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/clipboardformat/enumeration/llms.txt)
- **Next:** [CommentCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentcollection/add-method/llms.txt)
