2 つのタイム スケジュールを設定して比較するこのサンプル フォームがあります。
1番目のスケジュール(開始時刻と終了時刻)の間に2番目のスケジュールを設定できない時間をトラップしたい。
例: 最初のスケジュール: 8:00:00 AM から 10:00:00 AM 午前 8:30:00、9:00 のように最初のスケジュールの間に設定できないように、2 番目のスケジュールをトラップしたい:午前 0 時、9:30:00 など。.10:00:00 AM 以上に設定されます。どうすればそれを行うことができますか?
ある種のコードを作成しましたが、その方法を理解するのは難しいです。誰でも助けることができますか?
ここに私のサンプルコードがあります:
Private Sub Test_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
If timeStart.EditValue > timeEnd.EditValue Then
XtraMessageBox.Show("Time end must higher than time start", "", MessageBoxButtons.OK, MessageBoxIcon.Hand)
Exit Sub
ElseIf timeStart.EditValue = timeEnd.EditValue Then
XtraMessageBox.Show("Time start must not be equal to time end", "", MessageBoxButtons.OK, MessageBoxIcon.Hand)
Exit Sub
ElseIf timeStart1.EditValue < timeEnd.EditValue Then
XtraMessageBox.Show("Invalid", "", MessageBoxButtons.OK, MessageBoxIcon.Hand)
Exit Sub
ElseIf timeEnd1.EditValue < timeEnd.EditValue Then
XtraMessageBox.Show("Invalid", "", MessageBoxButtons.OK, MessageBoxIcon.Hand)
Exit Sub
End If
End Sub