バージョン

コンボボックスへの週の曜日の移植

UltraCalendarInfo オブジェクトを使用して、標準のコンボ コントロールに曜日を簡単に取り込むことができます。LongDescriptionResolved プロパティを使用することによって、LongDescription プロパティが明示的に設定されていない場合にシステムのロケール設定が使用されます。

Visual Basic の場合:

Imports Infragistics.Win.UltraWinSchedule
...
Private Sub PopulateaCombowiththeDaysoftheWeek_Load(ByVal sender As System.Object, _
  ByVal e As System.EventArgs) Handles MyBase.Load
	Me.UltraComboEditor1.Items.Clear()
	Me.UltraComboEditor1.Items.Add( _
	  Me.UltraCalendarInfo1.DaysOfWeek(DayOfWeekEnum.Sunday).LongDescriptionResolved)
	Me.UltraComboEditor1.Items.Add( _
	  Me.UltraCalendarInfo1.DaysOfWeek(DayOfWeekEnum.Monday).LongDescriptionResolved)
	Me.UltraComboEditor1.Items.Add( _
	  Me.UltraCalendarInfo1.DaysOfWeek(DayOfWeekEnum.Tuesday).LongDescriptionResolved)
	Me.UltraComboEditor1.Items.Add( _
	  Me.UltraCalendarInfo1.DaysOfWeek(DayOfWeekEnum.Wednesday).LongDescriptionResolved)
	Me.UltraComboEditor1.Items.Add( _
	  Me.UltraCalendarInfo1.DaysOfWeek(DayOfWeekEnum.Thursday).LongDescriptionResolved)
	Me.UltraComboEditor1.Items.Add( _
	  Me.UltraCalendarInfo1.DaysOfWeek(DayOfWeekEnum.Friday).LongDescriptionResolved)
	Me.UltraComboEditor1.Items.Add( _
	  Me.UltraCalendarInfo1.DaysOfWeek(DayOfWeekEnum.Saturday).LongDescriptionResolved)
End Sub

C# の場合:

using Infragistics.Win.UltraWinSchedule;
...
private void PopulateACombowiththeDaysoftheWeek_Load(object sender, System.EventArgs e)
{
	this.ultraComboEditor1.Items.Clear();
	this.ultraComboEditor1.Items.Add(
	  this.ultraCalendarInfo1.DaysOfWeek[DayOfWeekEnum.Sunday].LongDescriptionResolved);
	this.ultraComboEditor1.Items.Add(
	  this.ultraCalendarInfo1.DaysOfWeek[DayOfWeekEnum.Monday].LongDescriptionResolved);
	this.ultraComboEditor1.Items.Add(
	  this.ultraCalendarInfo1.DaysOfWeek[DayOfWeekEnum.Tuesday].LongDescriptionResolved);
	this.ultraComboEditor1.Items.Add(
	  this.ultraCalendarInfo1.DaysOfWeek[DayOfWeekEnum.Wednesday].LongDescriptionResolved);
	this.ultraComboEditor1.Items.Add(
	  this.ultraCalendarInfo1.DaysOfWeek[DayOfWeekEnum.Thursday].LongDescriptionResolved);
	this.ultraComboEditor1.Items.Add(
	  this.ultraCalendarInfo1.DaysOfWeek[DayOfWeekEnum.Friday].LongDescriptionResolved);
	this.ultraComboEditor1.Items.Add(
	  this.ultraCalendarInfo1.DaysOfWeek[DayOfWeekEnum.Saturday].LongDescriptionResolved);
}