- - PR -
コンソールからのForm表示時におけるTopMostプロパティについて
1
投稿者 | 投稿内容 |
---|---|
|
投稿日時: 2007-08-26 17:28
お世話になってます。
コンソールプログラムからFormを呼び出すプログラムを作ったのですが、呼び出されたFormのTopMostプロパティをtrueにしても前面表示されません。 コンソールプログラムから呼び出されたFormを前面表示するにはどうしたらいいのでしょうか。 簡略化したものを張っておきます。ご教授のほど、よろしくお願いします。 class Program { static void Main(string[] args) { int intCount = 0; Form1 form = new Form1(); form.TopMost = true; Console.WriteLine("limit:"); string strLimit = Console.ReadLine(); int intLimit = Convert.ToInt32(strLimit); while (true) { Console.WriteLine(intCount.ToString()); if (intLimit == intCount) { break; } Thread.Sleep(1000); intCount++; } Application.Run(form); } |
|
投稿日時: 2007-08-26 17:53
コンソールなのにフォーム?
TopMostはApplication.Run()はLoadイベント終了後でないとまずいんでないか? |
|
投稿日時: 2007-08-26 19:06
ありがとうございます。
ご指摘とおり、loadイベントにactivateをかませたらできました。 |
1