Click here to Skip to main content
15,910,981 members
Home / Discussions / C#
   

C#

 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP26-Sep-19 22:53
professional#realJSOP26-Sep-19 22:53 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
dan!sh 27-Sep-19 1:09
professional dan!sh 27-Sep-19 1:09 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP27-Sep-19 5:45
professional#realJSOP27-Sep-19 5:45 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661329-Sep-19 20:48
professionalsteve_949661329-Sep-19 20:48 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
dan!sh 29-Sep-19 23:04
professional dan!sh 29-Sep-19 23:04 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP30-Sep-19 1:11
professional#realJSOP30-Sep-19 1:11 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 1:44
professionalsteve_949661330-Sep-19 1:44 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP30-Sep-19 2:00
professional#realJSOP30-Sep-19 2:00 
Declare an EXTERNAL static class that the form can access

C#
public static class Globals
{
    public static MyDateTime { get; set; }
}
In your form, when you close it:

Globals.MyDateTime = DateTime.Now;

When your form closes, examine Globals.MyDateTime to ensure it's the expected value.

The next time you open the form, the value will be the same as the last time you opened the form, and when you close it agaim, set Globals.MyDateTime again.

The Globals.DateTime will be available everywhere else in the app as well.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 21:27
professionalsteve_949661330-Sep-19 21:27 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
dan!sh 30-Sep-19 2:04
professional dan!sh 30-Sep-19 2:04 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 1:39
professionalsteve_949661330-Sep-19 1:39 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP30-Sep-19 2:02
professional#realJSOP30-Sep-19 2:02 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 2:30
professionalsteve_949661330-Sep-19 2:30 
AnswerRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
dan!sh 27-Sep-19 1:08
professional dan!sh 27-Sep-19 1:08 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661327-Sep-19 1:52
professionalsteve_949661327-Sep-19 1:52 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
dan!sh 29-Sep-19 23:02
professional dan!sh 29-Sep-19 23:02 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 2:18
professionalsteve_949661330-Sep-19 2:18 
QuestionHow to press a key with TranslateMessage Pin
Member 1305673426-Sep-19 1:42
Member 1305673426-Sep-19 1:42 
AnswerRe: How to press a key with TranslateMessage Pin
Richard Deeming26-Sep-19 2:02
mveRichard Deeming26-Sep-19 2:02 
GeneralRe: How to press a key with TranslateMessage Pin
Member 1305673426-Sep-19 2:10
Member 1305673426-Sep-19 2:10 
GeneralRe: How to press a key with TranslateMessage Pin
Richard Deeming26-Sep-19 2:14
mveRichard Deeming26-Sep-19 2:14 
AnswerRe: How to press a key with TranslateMessage Pin
OriginalGriff26-Sep-19 2:23
mveOriginalGriff26-Sep-19 2:23 
QuestionChanging many projects from AnyCPU to x64 Pin
Bernhard Hiller24-Sep-19 22:04
Bernhard Hiller24-Sep-19 22:04 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
OriginalGriff24-Sep-19 22:29
mveOriginalGriff24-Sep-19 22:29 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
harold aptroot24-Sep-19 23:33
harold aptroot24-Sep-19 23:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.