I believe what i am trying to do is very simple but I get the error. Operator '*' cannot be applied to operands of type 'method group' and 'double'
I want to multiply the number of days that have been stored in dayrental by the amount 19.95 if that checkbox is checked. I get the error that says I cant because dayrental is a method. How can I get the value from dayrental so that I can multiple by 19.95?
private void button1_Click(object sender, EventArgs e)
{
double rental;
dayrental();
if (checkBox1.Checked == true)
rental = dayrental * 19.95;
label4.Text = Convert.ToString(rental);
}
private void label4_Click(object sender, EventArgs e)
{
}
public void dayrental()
{
var timeSpan = dateTimePicker2.Value - dateTimePicker1.Value;
var rentalDays = timeSpan.Days;
//label4.Text = Convert.ToString(rentalDays);
}