'宣言 Public Property DateTimeFormatInfo As DateTimeFormatInfo
public DateTimeFormatInfo DateTimeFormatInfo {get; set;}
DateTimeFormatInfo プロパティは日付を解析して書式設定するために使用されるオブジェクトです。null の場合、現在のカルチャの日付時間書式情報が使用されます。
Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Imports Infragistics.Win.UltraWinSchedule.CalendarCombo Private Sub GetFormatInfo() Dim info As String = String.Empty ' If the DateTimeFormatInfo property returns null, the current culture's ' DateTimeFormatInfo in in effect If (Not Me.ultraCalendarCombo1.DateTimeFormatInfo Is Nothing) Then info += "The current culture's DateTimeFormatInfo is in effect." + vbCrLf End If ' Use the DateTimeFormatInfoResolved property to get the actual ' DateTimeFormatInfo, which will return a valid value even when the ' DateTimeFormatInfo property has not been set. info += "The LongDatePattern is '" + Me.ultraCalendarCombo1.DateTimeFormatInfoResolved.LongDatePattern + "'" + vbCrLf info += "The LongTimePattern is '" + Me.ultraCalendarCombo1.DateTimeFormatInfoResolved.LongTimePattern + "'" + vbCrLf info += "The ShortDatePattern is '" + Me.ultraCalendarCombo1.DateTimeFormatInfoResolved.ShortDatePattern + "'" + vbCrLf info += "The ShortTimePattern is '" + Me.ultraCalendarCombo1.DateTimeFormatInfoResolved.ShortTimePattern + "'" + vbCrLf MessageBox.Show(info, "GetFormatInfo", MessageBoxButtons.OK) End Sub
using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; using Infragistics.Win.UltraWinSchedule.CalendarCombo; private void GetFormatInfo() { string info = string.Empty; // If the DateTimeFormatInfo property returns null, the current culture's // DateTimeFormatInfo in in effect if ( this.ultraCalendarCombo1.DateTimeFormatInfo != null ) info += "The current culture's DateTimeFormatInfo is in effect." + "\n"; // Use the DateTimeFormatInfoResolved property to get the actual // DateTimeFormatInfo, which will return a valid value even when the // DateTimeFormatInfo property has not been set. info += "The LongDatePattern is '" + this.ultraCalendarCombo1.DateTimeFormatInfoResolved.LongDatePattern + "'" + "\n"; info += "The LongTimePattern is '" + this.ultraCalendarCombo1.DateTimeFormatInfoResolved.LongTimePattern + "'" + "\n"; info += "The ShortDatePattern is '" + this.ultraCalendarCombo1.DateTimeFormatInfoResolved.ShortDatePattern + "'" + "\n"; info += "The ShortTimePattern is '" + this.ultraCalendarCombo1.DateTimeFormatInfoResolved.ShortTimePattern + "'" + "\n"; MessageBox.Show( info, "GetFormatInfo", MessageBoxButtons.OK ); }