View Full Version : Anyone familiar with C#?
toddex
2009-09-09, 11:42 PM
Pretty much what I want to do is after clicking my button open up a new form and after a set amount of time have it close() the entire program not just the new form.
Ashtar
2009-09-10, 07:24 AM
In a C# WPF application to exit you can call:
((App.Current) as App).Shutdown();
Which shuts the application down.
A timer usually looks like this.
private static Timer ticker;
public static void TimerMethod(Object state)
{
Console.Write(".");
}
public static void Main()
{
ticker = new Timer(TimerMethod, null, 1000, 1000);
Console.WriteLine("Press the Enter key to end the program.");
Console.ReadLine();
}
Are you working in WPF C#?
You would usually start the timer on the window_loaded method.
I personally prefur thinking about it, and reading it in D♭. But that's just a personal choice.
Haruki-kun
2009-09-10, 10:32 AM
I personally prefur thinking about it, and reading it in D♭. But that's just a personal choice.
This post gets a seal of approval.
http://www.istockphoto.com/file_thumbview_approve/2381624/2/istockphoto_2381624-seal-of-approval.jpg :smallbiggrin:
Linkavitch
2009-09-10, 04:03 PM
I totally thought you meant the musical key of C# when I saw this.
Powered by vBulletin® Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.