'宣言 Public ReadOnly Property CurrentState As CalendarComboState
public CalendarComboState CurrentState {get;}
状態: | |
---|---|
EditReadOnly | ReadOnly プロパティは True です。 |
DroppedDown | DroppedDown プロパティは True です。 |
AutoCloseUp | AutoCloseUp プロパティは True です。 |
MonthPopupDisplayed | Infragistics.Win.UltraWinSchedule.MonthViewMulti.UltraMonthPopupControl が現在表示されています。 |
VisibleMonths | UltraMonthViewMultiBase.VisibleMonths コレクションには少なくとも 1 つ Infragistics.Win.UltraWinSchedule.MonthViewMulti.VisibleMonth のがあります。 |
ActiveDay | UltraScheduleControlBase.CalendarInfo には null 以外の UltraCalendarInfo.ActiveDayのがあります。 |
Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Imports Infragistics.Win.UltraWinSchedule.CalendarCombo Private Sub GetCurrentState() Dim info As String = "The control is in the following state(s):" + vbCrLf + vbCrLf ' The CurrentState property is expressed in terms of bit flags, ' since the control can be in more than one distinct state at any ' given time. We will strip each bit that is set until we are left with ' no set bits, recording the corresponding state value with each iteration. Dim state As Long = Me.ultraCalendarCombo1.CurrentState Dim mask As Long = 1 While (state > 0) ' See if the bit that corresponds to the current value of the mask ' is set if it is, get the name of the enumeration for that state If ((state And mask) <> 0) Then Dim comboState As CalendarComboState = mask info += comboState.ToString() + vbCrLf ' Strip out the bit so we know when to exit this while loop state = state And (Not mask) End If ' Multiply the mask by 2 to set it to the next power of 2, ' effectively shifting the bit position we are checking one ' place to the right mask *= 2 End While ' Display the state information in a message box MessageBox.Show(info, "GetCurrentState", MessageBoxButtons.OK) End Sub
using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; using Infragistics.Win.UltraWinSchedule.CalendarCombo; private void GetCurrentState() { string info = "The control is in the following state(s):" + "\n" + "\n"; // The CurrentState property is expressed in terms of bit flags, // since the control can be in more than one distinct state at any // given time. We will strip each bit that is set until we are left with // no set bits, recording the corresponding state value with each iteration. long state = (long)this.ultraCalendarCombo1.CurrentState; long mask = 1; while ( state > 0 ) { // See if the bit that corresponds to the current value of the mask // is set; if it is, get the name of the enumeration for that state if ( ( state & mask ) != 0 ) { CalendarComboState comboState = (CalendarComboState)( mask ); info += comboState.ToString() + "\n"; // Strip out the bit so we know when to exit this while loop state &= ~mask; } // Multiply the mask by 2 to set it to the next power of 2, // effectively shifting the bit position we are checking one // place to the right mask *= 2; } // Display the state information in a message box MessageBox.Show( info, "GetCurrentState", MessageBoxButtons.OK ); }