Click here to Skip to main content
14,356,466 members
   

C#

 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP26-Sep-19 23:53
mve#realJSOP26-Sep-19 23:53 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
lw@zi 27-Sep-19 2:09
professional lw@zi 27-Sep-19 2:09 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP27-Sep-19 6:45
mve#realJSOP27-Sep-19 6:45 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661329-Sep-19 21:48
professionalsteve_949661329-Sep-19 21:48 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
lw@zi 30-Sep-19 0:04
professional lw@zi 30-Sep-19 0:04 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP30-Sep-19 2:11
mve#realJSOP30-Sep-19 2:11 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 2:44
professionalsteve_949661330-Sep-19 2:44 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP30-Sep-19 3:00
mve#realJSOP30-Sep-19 3:00 
Declare an EXTERNAL static class that the form can access

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 22:27
professionalsteve_949661330-Sep-19 22:27 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
lw@zi 30-Sep-19 3:04
professional lw@zi 30-Sep-19 3:04 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 2:39
professionalsteve_949661330-Sep-19 2:39 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP30-Sep-19 3:02
mve#realJSOP30-Sep-19 3:02 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 3:30
professionalsteve_949661330-Sep-19 3:30 
AnswerRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
lw@zi 27-Sep-19 2:08
professional lw@zi 27-Sep-19 2:08 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661327-Sep-19 2:52
professionalsteve_949661327-Sep-19 2:52 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
lw@zi 30-Sep-19 0:02
professional lw@zi 30-Sep-19 0:02 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 3:18
professionalsteve_949661330-Sep-19 3:18 
QuestionHow to press a key with TranslateMessage Pin
Member 1305673426-Sep-19 2:42
memberMember 1305673426-Sep-19 2:42 
AnswerRe: How to press a key with TranslateMessage Pin
Richard Deeming26-Sep-19 3:02
mveRichard Deeming26-Sep-19 3:02 
GeneralRe: How to press a key with TranslateMessage Pin
Member 1305673426-Sep-19 3:10
memberMember 1305673426-Sep-19 3:10 
GeneralRe: How to press a key with TranslateMessage Pin
Richard Deeming26-Sep-19 3:14
mveRichard Deeming26-Sep-19 3:14 
AnswerRe: How to press a key with TranslateMessage Pin
OriginalGriff26-Sep-19 3:23
protectorOriginalGriff26-Sep-19 3:23 
QuestionChanging many projects from AnyCPU to x64 Pin
Bernhard Hiller24-Sep-19 23:04
memberBernhard Hiller24-Sep-19 23:04 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
OriginalGriff24-Sep-19 23:29
protectorOriginalGriff24-Sep-19 23:29 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
harold aptroot25-Sep-19 0:33
memberharold aptroot25-Sep-19 0: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.