C#: Possibly a polymorphism function? But not sure
<p>I'm currently working on a lab for class and we were told to make a method in the main form called "DisplayInformation. that accepts a parameter of type Time and then displays the Time objects information" Which doesn't sound difficult to me but we're told to use 2 buttons to access this method. One just goes to the base class and gets the current time and returns it. The other is suppose to go to a derived class. And this is where my problem begins.    </p>

<pre><code>private void btnDisplayTime_Click(object sender, EventArgs e)
{
    DisplayInformation(time1);


} 
</code></pre>

<p>And this is the DisplayInformation function I'm not sure about:</p>

<pre><code>private string DisplayInformation (Time zone)
        {
            time1 = zone;
            time1.displayTime();
           // extTime1.displayTime();
            return "okay";

        }//end of DisplayInformation
</code></pre>

<p>When i call DisplayInformation with the first button it'll go just fine.
And if i make a call from the second button to this method it'll be fine as well. But i need  to be able to pick and choose which class i go to. It's difficult to explain really. 
I just need to be able to call from each button to that method and get a different output depending on the button. I'm not sure if this would just be an if statement or what.</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CIS247A_Week_4_Lab_BREWER
{
class Time
{
    private const int MIN_HOUR = 0;
    private const int MAX_HOUR = 24;
    internal int hour;
    internal int minute;

    public Time()
    {
        hour = 12;
        minute = 00;
    }//end of Time

    public Time(int Hour, int Minute)
    {
        hour = Hour;
        minute = Minute;
    }//end of Time

    public int incrementHour(int step)
    {
        if (step &gt; 0 &amp;&amp; hour &lt; 24)
        {
            //step = step % hour;
            hour = (hour + step) % 24;

            return hour;
        }//end of if

        else
        {
            MessageBox.Show("Please enter a positive number.");

            return 0;
        }//end of else
    }//end of incrementHour

    public int incrementMinute(int step)
    {
        if (step &gt; 0 &amp;&amp; minute &lt; 60)
        {
            minute = (minute + step) / 60;

            return 0;
        }//end of if

        else if (step &lt; 0)
        {
            MessageBox.Show("Please enter a positive number.");
            minute = 0;
            return 0;
        }//end of else if
        else
        {
            MessageBox.Show("Unknown error.");
            return 0;
        }
    }//end of incrementMinute
    public virtual string displayTime()
    {
        DateTime time = DateTime.Now; // Use current time
        string format = "MMM ddd d HH:mm yyyy"; // Use this format
        MessageBox.Show(time.ToString(format)); // Write to console

        return time.ToString(format);
    }//end of displayTime

    public int Hour
    {
        get { return hour; }


        set
        {
            if (value &lt; MIN_HOUR)
            {
                hour = 0;
                MessageBox.Show("Hour value " + value.ToString() + " cannot be negative. Reset to " + MIN_HOUR.ToString(),
                "Invalid Hour", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                //take the modulus to ensure always less than 24 hours
                //works even if the value is already within range, or value equal to 24
                hour = value % MAX_HOUR;
            }
        }
    }
    public int Minute
    {
        get { return minute; }
        set
        {
            if (value &lt; 0)
            {
                minute = 0;
                //MessageBox.Show("cannot be negitive" , MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                minute = value % 60;
            }


        }
    }
}//end of Time Class
}//end of Namespace
</code></pre>

<p>And the extendedtime class</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CIS247A_Week_4_Lab_BREWER
{

class ExtendedTime : Time
{

    private string timeZone{get; set;}

    public ExtendedTime() : base()
    {
        timeZone = "CDT";

    }//end of ExtendedTime

    public ExtendedTime(int Hour, int Minute, String TimeZone) :base(Hour, Minute)
    {

        timeZone = TimeZone;
    }//end of ExtendedTime

    public override string displayTime()
    {
        //return base.displayTime();
        MessageBox.Show(base.displayTime() + timeZone);
        return base.displayTime() + timeZone;
    }//end of DisplayTime

}//end of ExtendedTime class

}//end of namespace
</code></pre>

<p>And just for time sake the section of the form i'm working on:</p>

<pre><code>public partial class frmTime : Form
    {
        Time time1;
        ExtendedTime extTime1;


    public frmTime()
    {
        //DateTime Ctime = DateTime.Now; // Use current time
       // Ctime = new DateTime();
       // label1.Text = Ctime.ToString();
        InitializeComponent();
        time1 = new Time();
        extTime1 = new ExtendedTime();
    }


    private void DisplayInformation (Time zone)
    {
        time1 = zone;
       // time1.displayTime();
        extTime1.displayTime();
        //return "okay";

    }//end of DisplayInformation
    //exit Button (btnExit)
    private void btnExit_Click(object sender, EventArgs e)
    {
        Application.Exit();//closes the program

    }

    private void btnDisplayTime_Click(object sender, EventArgs e)
    {
        DisplayInformation(time1);


    }
</code></pre>
