作成日: 2020/05/11 最終更新日: 2020/05/11
文書種別
使用方法
詳細
C1DateEditで、マウスホイールによって日付編集が行われる動作を無効にするには、次のようなコードを使用することが可能です。
(1)C1DateEditコントロールのアップダウンボタンを表示した場合
C1DateEditのUpDownButtonClickイベントにて、e.Done = Trueを設定します。
◎サンプルコード(VB)
(2)C1DateEditコントロールのアップダウンボタンを非表示にした場合
MouseWheelイベントを追加し、そこでHandled = trueを設定します。
◎サンプルコード(VB)
(1)C1DateEditコントロールのアップダウンボタンを表示した場合
C1DateEditのUpDownButtonClickイベントにて、e.Done = Trueを設定します。
◎サンプルコード(VB)
C1DateEdit1.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.UpDown
・・・途中省略・・・
Private Sub C1DateEdit1_UpDownButtonClick(sender As Object, e As C1.Win.C1Input.UpDownButtonClickEventArgs) Handles C1DateEdit1.UpDownButtonClick
e.Done = True
End Sub
◎サンプルコード(C#) c1DateEdit1.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.UpDown;
・・・途中省略・・・
private void c1DateEdit1_UpDownButtonClick(object sender, C1.Win.C1Input.UpDownButtonClickEventArgs e)
{
e.Done = true;
}
(2)C1DateEditコントロールのアップダウンボタンを非表示にした場合
MouseWheelイベントを追加し、そこでHandled = trueを設定します。
◎サンプルコード(VB)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
C1DateEdit1.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.DropDown
AddHandler C1DateEdit1.MouseWheel, AddressOf C1DateEdit1_MouseWheel
End Sub
Private Sub C1DateEdit1_MouseWheel(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim eventArgs As HandledMouseEventArgs = CType(e, HandledMouseEventArgs)
eventArgs.Handled = True
End Sub
◎サンプルコード(C#) private void form1_Load(object sender, EventArgs e)
{
c1DateEdit1.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.DropDown;
c1DateEdit1.MouseWheel
+= new System.Windows.Forms.MouseEventHandler(c1DateEdit1_MouseWheel);
}
private void c1DateEdit1_MouseWheel(object sender, MouseEventArgs e)
{
HandledMouseEventArgs eventArgs = e as HandledMouseEventArgs;
eventArgs.Handled = true;
}
関連情報
旧文書番号
85554