[Solved] operator ‘< ' cannot be applied to operands of type 'system.windows.forms.datetimepicker' and 'system.datetime' [closed]


You need to use it’s .Value property of your object to compare it, not itself.

if (dtpTravelDate.Value < DateTime.Now)
{
    MessageBox.Show("Date Selected Cannot be Before Today's Date");
}

solved operator ‘< ' cannot be applied to operands of type 'system.windows.forms.datetimepicker' and 'system.datetime' [closed]