'宣言 Public Property ShowClickToAddIndicator As Infragistics.Win.DefaultableBoolean
public Infragistics.Win.DefaultableBoolean ShowClickToAddIndicator {get; set;}
Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim result As DialogResult = MessageBox.Show(Me, "Would you like to Enable the 'Click To Add' feature?", "ClickToAdd", MessageBoxButtons.YesNoCancel) Dim propertyValue As DefaultableBoolean = DefaultableBoolean.Default If (result = DialogResult.Yes) Then propertyValue = DefaultableBoolean.True ElseIf (result = DialogResult.No) Then propertyValue = DefaultableBoolean.False End If If (propertyValue <> DefaultableBoolean.Default) Then Me.ultraDayView1.ShowClickToAddIndicator = propertyValue Me.ultraWeekView1.ShowClickToAddIndicator = propertyValue Me.ultraMonthViewSingle1.ShowClickToAddIndicator = propertyValue End If End Sub
using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; using System.Diagnostics; private void button1_Click(object sender, System.EventArgs e) { DialogResult result = MessageBox.Show( this, "Would you like to Enable the 'Click To Add' feature?", "ClickToAdd", MessageBoxButtons.YesNoCancel ); DefaultableBoolean propertyValue = DefaultableBoolean.Default; if ( result == DialogResult.Yes ) propertyValue = DefaultableBoolean.True; else if ( result == DialogResult.No ) propertyValue = DefaultableBoolean.False; if ( propertyValue != DefaultableBoolean.Default ) { this.ultraDayView1.ShowClickToAddIndicator = propertyValue; this.ultraWeekView1.ShowClickToAddIndicator = propertyValue; this.ultraMonthViewSingle1.ShowClickToAddIndicator = propertyValue; } }