Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Imports Infragistics.Win.UltraWinSchedule.MonthViewSingle Private Sub SetupScrollbar() Dim result As DialogResult ' スクロールバーを表示するかどうかを確認します result = MessageBox.Show("Would you like the control to display its vertical scrollbar?", "SetupScrollbar", MessageBoxButtons.YesNoCancel) If result = DialogResult.Cancel Then Return If result = DialogResult.Yes Then Me.UltraMonthViewSingle1.ScrollbarVisible = True Else ' 表示しないには、ScrollbarVisible プロパティを False に ' 設定して、返します Me.UltraMonthViewSingle1.ScrollbarVisible = False Return End If ' 両方にスクロール ボタンを表示するかどうかを確認します result = MessageBox.Show("Would you like to have the up and down scroll buttons appear on both ends of the scrollbar?", "SetupScrollbar", MessageBoxButtons.YesNoCancel) If result = DialogResult.Cancel Then Return If result = DialogResult.Yes Then Me.UltraMonthViewSingle1.CalendarLook.ScrollBarLook.ScrollBarArrowStyle = _ Infragistics.Win.UltraWinScrollBar.ScrollBarArrowStyle.BothAtEachEnd Else Me.UltraMonthViewSingle1.CalendarLook.ScrollBarLook.ScrollBarArrowStyle = _ Infragistics.Win.UltraWinScrollBar.ScrollBarArrowStyle.OneAtEachEnd End If ' 最小および最大ボタンを表示するかどうかを確認します result = MessageBox.Show("Would you like the Min/Max buttons to be displayed?", "SetupScrollbar", MessageBoxButtons.YesNoCancel) If result = DialogResult.Cancel Then Return If result = DialogResult.Yes Then Me.UltraMonthViewSingle1.CalendarLook.ScrollBarLook.MinMaxButtonsVisible = True Else Me.UltraMonthViewSingle1.CalendarLook.ScrollBarLook.MinMaxButtonsVisible = False End If ' ScrollChangeLarge を VisibleWeeks プロパティの値に設定する ' かどうかを確認します result = MessageBox.Show("Would you like to set the large scrolling increment equal to the number of visible weeks?", "SetupScrollbar", MessageBoxButtons.YesNoCancel) If result = DialogResult.Cancel Then Return If result = DialogResult.Yes Then ' ScrollChangeLarge プロパティを VisibleWeeks プロパティの値に設定します Me.UltraMonthViewSingle1.ScrollChangeLarge = Me.UltraMonthViewSingle1.VisibleWeeks End If ' ScrollChangeSmall を ScrollChangeLarge の値の半分に設定するかどうかを確認します result = MessageBox.Show("Would you like to set the small scrolling increment equal to half of the large scrolling increment?", "SetupScrollbar", MessageBoxButtons.YesNoCancel) If result = DialogResult.Cancel Then Return If result = DialogResult.Yes Then ' ScrollChangeSmall プロパティを ScrollChangeLarge の値の半分に設定します Me.UltraMonthViewSingle1.ScrollChangeSmall = Me.UltraMonthViewSingle1.ScrollChangeLarge / 2 End If End Sub
using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; using Infragistics.Win.UltraWinSchedule.MonthViewSingle; using System.Diagnostics; private void SetupScrollbar() { // スクロールバーを表示するかどうかを確認します DialogResult result = MessageBox.Show( "Would you like the control to display its vertical scrollbar?", "SetupScrollbar", MessageBoxButtons.YesNoCancel); if ( result == DialogResult.Cancel ) return; if ( result == DialogResult.Yes ) this.ultraMonthViewSingle1.ScrollbarVisible = true; else { // 表示しない場合は、ScrollbarVisible プロパティを False に // 設定して、返します this.ultraMonthViewSingle1.ScrollbarVisible = false; return; } // 両方にスクロール ボタンを表示するかどうかを確認します result = MessageBox.Show( "Would you like to have the up and down scroll buttons appear on both ends of the scrollbar?", "SetupScrollbar", MessageBoxButtons.YesNoCancel ); if ( result == DialogResult.Cancel ) return; if ( result == DialogResult.Yes ) { this.ultraMonthViewSingle1.CalendarLook.ScrollBarLook.ScrollBarArrowStyle = Infragistics.Win.UltraWinScrollBar.ScrollBarArrowStyle.BothAtEachEnd; } else { this.ultraMonthViewSingle1.CalendarLook.ScrollBarLook.ScrollBarArrowStyle = Infragistics.Win.UltraWinScrollBar.ScrollBarArrowStyle.OneAtEachEnd; } // 最小および最大ボタンを表示するかどうかを確認します result = MessageBox.Show( "Would you like the Min/Max buttons to be displayed?", "SetupScrollbar", MessageBoxButtons.YesNoCancel ); if ( result == DialogResult.Cancel ) return; if ( result == DialogResult.Yes ) { this.ultraMonthViewSingle1.CalendarLook.ScrollBarLook.MinMaxButtonsVisible = true; } else this.ultraMonthViewSingle1.CalendarLook.ScrollBarLook.MinMaxButtonsVisible = false; // ScrollChangeLarge を VisibleWeeks プロパティの値に設定する // かどうかを確認します result = MessageBox.Show( "Would you like to set the large scrolling increment equal to the number of visible weeks?", "SetupScrollbar", MessageBoxButtons.YesNoCancel ); if ( result == DialogResult.Cancel ) return; if ( result == DialogResult.Yes ) { // ScrollChangeLarge プロパティを VisibleWeeks プロパティの値に設定します this.ultraMonthViewSingle1.ScrollChangeLarge = this.ultraMonthViewSingle1.VisibleWeeks; } // ScrollChangeSmall を ScrollChangeLarge の値の半分に設定するかどうかを確認します result = MessageBox.Show( "Would you like to set the small scrolling increment equal to half of the large scrolling increment?", "SetupScrollbar", MessageBoxButtons.YesNoCancel ); if ( result == DialogResult.Cancel ) return; if ( result == DialogResult.Yes ) { // ScrollChangeSmall プロパティを ScrollChangeLarge の値の半分に設定します this.ultraMonthViewSingle1.ScrollChangeSmall = (int)( this.ultraMonthViewSingle1.ScrollChangeLarge / 2 ); } }