例項 如何製作乙個帶啟動螢幕的窗體

2021-04-13 02:41:02 字數 565 閱讀 3457

需要你準備兩個winform的窗體,乙個叫它:splashscreen,把它做成乙個漂亮的窗體。然後你需要乙個主窗體叫它:form1吧,然後在這個窗體加入下面的**。

// ( c# )

protected override void onload ( system.eventargs e )

//make load take a long time

thread.sleep(2000);

base.onload(e);

然後在main中加入這樣的**:

[stathread]

static void main()

splashscreen splashform = new splashscreen();

splashform.show();

form1 mainform = new form1() ;

mainform.load += new eventhandler(splashform.mainscreen_load);

不要忘了加上對threading的引用: using system.threading;

只啟動乙個程式例項,如果已執行則調到前端

1.設定互斥量,並查詢視窗,在initinstance 函式中實現 handle hsingleton createmutex null,false,szmutexname if getlasterror error already exists setforegroundwindow hwndpr...

如何製作乙個簡單的機械臂

了解如何使用可通過外部電位器控制的伺服電機製作簡單的機械臂。機械人有多種形式,包括無人機 汽車 火星車,甚至步行者。讓機械人在其環境中移動非常重要,讓它與環境進行互動同樣重要。本文將向您展示如何製作乙個能夠通過外部電位器四處移動並指向物體的簡易機械臂。伺服電機 線性電位器 arduino uno開發...

如何製作乙個簡單的換膚功能

每一次的切換就會更改掉本地資訊,就不會因為重新整理而導致背景還原成預設狀態 但是!在這裡要注意一點就是,如果最開始沒有設定風格,就應該預設個預設樣式,通過查詢本地是否儲存的有該資料,如果沒有則使用預設的樣式 html 1 doctype html 2 html 3 head 4 meta chars...