Back to Devexpress

AppointmentLabelCollection.CreateNewLabel(String) Method

windowsforms-devexpress-dot-xtrascheduler-dot-appointmentlabelcollection-dot-createnewlabel-x28-system-dot-string-x29.md

latest3.3 KB
Original Source

AppointmentLabelCollection.CreateNewLabel(String) Method

Creates a new label with the identifier created by default, specified displayed name and menu caption which is the same as display name.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public AppointmentLabel CreateNewLabel(
    string displayName
)
vb
Public Function CreateNewLabel(
    displayName As String
) As AppointmentLabel

Parameters

NameTypeDescription
displayNameString

A string that is the label name used for identification in label editors.

|

Returns

TypeDescription
AppointmentLabel

A newly created AppointmentLabel object.

|

Remarks

This method creates a label with an identifier provided automatically by the AppointmentLabelCollection object. The label’s Color property is set to Color.White. The caption of a context menu used to change a label for an appointment is the same as its display name.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CreateNewLabel(String) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-scheduler-mapping-converters/CS/SchedulerMappingConverterExample/Form1.cs#L13

csharp
AppointmentLabel label = schedulerStorage1.Appointments.Labels.CreateNewLabel("Violet");
label.SetColor(System.Drawing.Color.Violet);

winforms-scheduler-mapping-converters/VB/SchedulerMappingConverterExample/Form1.vb#L15

vb
Dim label As AppointmentLabel = schedulerStorage1.Appointments.Labels.CreateNewLabel("Violet")
label.SetColor(System.Drawing.Color.Violet)

See Also

AppointmentLabelCollection Class

AppointmentLabelCollection Members

DevExpress.XtraScheduler Namespace