I am working on a WPF project which allows one to enter a comment in one text box, and when s/he presses a button the comment written is posted into another textbox, aside from this the last comment posted needs to be posted on the previous. So if for example comment 1 is posted at 10pm and the other at 11pm the 11 pm comment is put on top of the 10 pm comment. How can I do this?
<TextBox x:Name="txtWriteComments" MinLines="4"/>
<Button x:Name="btnPostComments" Content="Post Comment" Click="btnPostComments_Click"/>
Code in Main Window.cs
private void btnPostComments_Click(object sender, RoutedEventArgs e)
{
int i = 0;
TimeSpan time = DateTime.Now.TimeOfDay;
do
{
i++;
???
} while (i < 6);
}
I did the counter because it will only allow a maximum of 5 comments