Show / Hide Table of Contents

# Class RadioButtonGroup

An object representing a Group of Radio Buttons that can be used to create new Radio Buttons. If a group contains multiple buttons they will be connected.

##### Inheritance

object
RadioButtonGroup

##### Implements

IDisposable

##### Inherited Members

object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

###### Namespace: pdftron.PDF.Annots

###### Assembly: PDFNet.dll

##### Syntax

    public class RadioButtonGroup : IDisposable

### Constructors

#### RadioButtonGroup(Field)

Creates a RadioButtonGroup and initialize it using given Field object.

##### Declaration

    public RadioButtonGroup(Field field)

##### Parameters

Type | Name | Description
--- | --- | ---
Field | field | The field with which to initialize the RadioButtonGroup

##### Remarks

The constructor does not copy any data, but is instead the logical equivalent of a type cast.

### Methods

#### Add(Rect)

Adds a RadioButtonWidget with a default onstate to the RadioButtonGroup

##### Declaration

    public RadioButtonWidget Add(Rect pos)

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | pos | A rectangle specifying the annotation's bounds, specified in user space coordinates.

##### Returns

Type | Description
--- | ---
RadioButtonWidget | A newly created default RadioButtonWidget.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Add(Rect, string)

Adds a new RadioButtonWidget to the RadioButtonGroup

##### Declaration

    public RadioButtonWidget Add(Rect pos, string onstate)

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | pos | A rectangle specifying the annotation's bounds, specified in user space coordinates.
string | onstate | The onstate for this button. This will rarely need to be explicitly set. However, it can be used to allow multiple radiobuttons in a group to be on at once if they have the same onstate.

##### Returns

Type | Description
--- | ---
RadioButtonWidget | A newly created default RadioButtonWidget.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### AddGroupButtonsToPage(Page)

Add all group buttons to the page

##### Declaration

    public void AddGroupButtonsToPage(Page page)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | The page in which to add the buttons.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Create(PDFDoc)

Creates a new RadioButtonGroup, in the specified document with a default field name.

##### Declaration

    public static RadioButtonGroup Create(PDFDoc doc)

##### Parameters

Type | Name | Description
--- | --- | ---
PDFDoc | doc | The document in which the RadioButtonGroup is created.

##### Returns

Type | Description
--- | ---
RadioButtonGroup | A newly created blank Widget annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Create(PDFDoc, string)

Creates a new RadioButtonGroup in the specified document.

##### Declaration

    public static RadioButtonGroup Create(PDFDoc doc, string field_name)

##### Parameters

Type | Name | Description
--- | --- | ---
PDFDoc | doc | The document in which the RadioButtonGroup is created.
string | field_name | The name of the field to create and use in this RadioButtonGroup.

##### Returns

Type | Description
--- | ---
RadioButtonGroup | A newly created RadioButtonGroup.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Dispose()

Releases all resources used by this RadioButtonGroup

##### Declaration

    public override sealed void Dispose()

#### Dispose(bool)

##### Declaration

    [HandleProcessCorruptedStateExceptions]
    protected virtual void Dispose(bool A_0)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | A_0 |

#### ~RadioButtonGroup()

##### Declaration

    protected ~RadioButtonGroup()

#### GetButton(uint)

Retrieves the button at a given index.

##### Declaration

    public RadioButtonWidget GetButton(uint index)

##### Parameters

Type | Name | Description
--- | --- | ---
uint | index | The index to use.

##### Returns

Type | Description
--- | ---
RadioButtonWidget | The RadioButtonWidget at the given index

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetField()

Gets the field associated with this RadioButtonGroup

##### Declaration

    public Field GetField()

##### Returns

Type | Description
--- | ---
Field | The Field associated with this RadioButtonGroup

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetNumButtons()

Gets the number of buttons in this RadioButtonGroup

##### Declaration

    public uint GetNumButtons()

##### Returns

Type | Description
--- | ---
uint | The number of buttons in this RadioButtonGroup

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

### Implements

IDisposable