I am making Notepad using Windows Form and have a problem with the Date / Time function:
System time and date format (short): hh: mm tt M / d / yyyy. When I press F5 (Date / Time function) in Notepad, it adds a time line with the format as above. Then I change the format of the system time and date to HH: mm dd-MMM-YY and again press F5 in Notepad, adding another time line with the changed format.
But with my Notepad project (I use DateTime.Now.ToShortTimeString()it DateTime.Now.ToShortDateString()to execute this function), I need to run the program again if I want the format to take effect in my program, otherwise it will use the first format no matter how many times I click F5.
So, I want to ask if there is a way to fix this.
I am using VS 2013.
source
share