windowsforms-devexpress-dot-xtrascheduler-dot-reporting-dot-textinfocontrolbase-2da698cf.md
Occurs before the control is rendered, and enables you to modify the text being printed.
Namespace : DevExpress.XtraScheduler.Reporting
Assembly : DevExpress.XtraScheduler.v25.2.Reporting.dll
NuGet Package : DevExpress.Win.SchedulerReporting
public event TextCustomizingEventHandler CustomizeText
Public Event CustomizeText As TextCustomizingEventHandler
The CustomizeText event's data class is TextCustomizingEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Text | Gets or sets the text printed by the control. |
The CustomizeText event, in addition to the XRControl.BeforePrint event (which is inherited from the XtraReport control) provides the ability to modify the control’s content before it is printed. Event arguments for different controls are inherited from the TextCustomizingEventArgs base class, to implement properties specific to a particular control.
The following code sample handles the TextInfoControlBase.CustomizeText event for the TimeIntervalInfo control, to print the weekday name in French in the second text line of the control.
using DevExpress.XtraScheduler;
using DevExpress.XtraReports.UI;
using DevExpress.XtraScheduler.Reporting;
// ...
private void timeIntervalInfo1_CustomizeText(object sender,
DevExpress.XtraScheduler.Reporting.TextCustomizingEventArgs e) {
TimeIntervalTextCustomizingEventArgs args = (TimeIntervalTextCustomizingEventArgs)e;
args.SecondLineText = args.Interval.Start.ToString("dddd",
System.Globalization.CultureInfo.CreateSpecificCulture("fr-FR"));
}
Imports DevExpress.XtraScheduler
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraScheduler.Reporting
' ...
Private Sub timeIntervalInfo1_CustomizeText(ByVal sender As Object, _
ByVal e As DevExpress.XtraScheduler.Reporting.TextCustomizingEventArgs)
Dim args As TimeIntervalTextCustomizingEventArgs = _
CType(e, TimeIntervalTextCustomizingEventArgs)
args.SecondLineText = args.Interval.Start.ToString("dddd", _
System.Globalization.CultureInfo.CreateSpecificCulture("fr-FR"))
End Sub
The following code snippet handles the TextInfoControlBase.CustomizeText event of the ResourceInfo control, to print the resource captions with their IDs.
using DevExpress.XtraScheduler;
using DevExpress.XtraReports.UI;
using DevExpress.XtraScheduler.Reporting;
// ...
private void resourceInfo1_CustomizeText(object sender, TextCustomizingEventArgs e) {
ResourceTextCustomizingEventArgs args = (ResourceTextCustomizingEventArgs)e;
string text = "";
foreach(Resource res in args.Resources)
text = text + res.Caption + " (id = " + res.Id + ") ";
args.Text = text;
}
Imports DevExpress.XtraScheduler
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraScheduler.Reporting
' ...
Private Sub resourceInfo1_CustomizeText(ByVal sender As Object, ByVal e As TextCustomizingEventArgs)
Dim args As ResourceTextCustomizingEventArgs = CType(e, ResourceTextCustomizingEventArgs)
Dim text As String = ""
For Each res As Resource In args.Resources
text = text & res.Caption & " (id = " & res.Id & ") "
Next res
args.Text = text
End Sub
See Also