MochiuWiki : SUSE, EC, PCB
案内
メインページ
最近の更新
おまかせ表示
MediaWiki についてのヘルプ
ツール
リンク元
関連ページの更新状況
特別ページ
ページ情報
We ask for
Donations
検索
個人用ツール
ログイン
Toggle dark mode
名前空間
ページ
議論
表示
閲覧
ソースを閲覧
履歴を表示
C Sharpの応用 - スプラッシュウィンドウのソースを表示
提供: MochiuWiki : SUSE, EC, PCB
←
C Sharpの応用 - スプラッシュウィンドウ
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループのいずれかに属する利用者のみが実行できます:
管理者
、new-group。
このページのソースの閲覧やコピーができます。
== 概要 == スプラッシュウィンドウを表示するには、スプラッシュウィンドウ用のフォームを作成して、<br> アプリケーション起動時にフォームを表示することで実現できる。<br> <br><br> == サンプルコード == スプラッシュウィンドウ画面のオプションを下記のように設定する。<br> ・StartPositionプロパティ - CenterScreen<br> ・FormBorderStyleプロパティ - None<br> <br> <syntaxhighlight lang="c#"> // Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.Threading; namespace SplashWindow { static class Program { [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // スプラッシュフォームを表示 FormSplash fs = new FormSplash(); fs.Show(); fs.Refresh(); // 時間のかかる処理を記述する(Sleepメソッドで代用) Thread.Sleep(3000); // スプラッシュウィンドウを閉じる fs.Close(); // メインフォームを表示 Application.Run(new FormMain()); } } } </source> <br> <syntaxhighlight lang="c#"> // FormMain.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace SplashWindow { public partial class FormMain : Form { public FormMain() { InitializeComponent(); } private void FormMain_Load(object sender, EventArgs e) { } } } </source> <br> <syntaxhighlight lang="c#"> // FormSplash.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace SplashWindow { public partial class FormSplash : Form { public FormSplash() { InitializeComponent(); } private void FormSplash_Paint(object sender, PaintEventArgs e) { Rectangle rect = new Rectangle(0,0, this.Width, this.Height); ControlPaint.DrawBorder3D(e.Graphics, rect, Border3DStyle.Raised); } } } </source> <br><br> __FORCETOC__ [[カテゴリ:C_Sharp]]
C Sharpの応用 - スプラッシュウィンドウ
に戻る。
案内
メインページ
最近の更新
おまかせ表示
MediaWiki についてのヘルプ
ツール
リンク元
関連ページの更新状況
特別ページ
ページ情報
We ask for
Donations
Collapse