using system.runtime.interopservices;
[dllimport("user32")]
private static extern bool animatewindow(intptr hwnd, int dwtime, int dwflags);
//下面是可用的常量,按照不合的動畫結果宣告本身須要的
private const int aw_hor_positive = 0 x0001;//自左向右顯示視窗,該標記可以在遷移轉變動畫和滑動動畫中應用。應用aw_center標記時忽視該標記
private const int aw_hor_negative = 0 x0002;//自右向左顯示視窗,該標記可以在遷移轉變動畫和滑動動畫中應用。應用aw_center標記時忽視該標記
private const int aw_ver_positive = 0 x0004;//自頂向下顯示視窗,該標記可以在遷移轉變動畫和滑動動畫中應用。應用aw_center標記時忽視該標記
private const int aw_ver_negative = 0 x0008;//自下向上顯示視窗,該標記可以在遷移轉變動畫和滑動動畫中應用。應用aw_center標記時忽視該標記該標記
private const int aw_center = 0 x0010;//若應用了aw_hide標記,則使視窗向內重疊;不然向外擴大
private const int aw_hide = 0 x10000;//隱蔽視窗
private const int aw_active = 0 x20000;//啟用視窗,在應用了aw_hide標記後不要應用這個標記
private const int aw_slide = 0 x40000;//應用滑動型別動畫結果,預設為遷移轉變動畫型別,當應用aw_center標記時,這個標記就被忽視
private const int aw_blend = 0 x80000;//應用淡入淡出結果
private void form1_load(object sender, eventargs e)
int x = screen.primaryscreen.workingarea.right - this.width;
int y = screen.primaryscreen.workingarea.bottom - this.height;
this.location = new point(x, y);//設定窗體在螢幕右下角顯示
animatewindow(this.handle, 1000, aw_slide | aw_active | aw_ver_negative);
private void form1_formclosing(object sender, formclosingeventargs e)
animatewindow(this.handle, 1000, aw_blend | aw_hide);
C Winform 右下角彈出框
using system using system.collections.generic using system.componentmodel using system.data using system.drawing using system.linq using system.text u...
C winform 右下角彈出視窗結果
from using system.runtime.interopservices dllimport user32 private static extern bool animatewindow intptr hwnd,int dwtime,int dwflags 下面是可用的常量,按照不合的動...
C winform 右下角彈出視窗效果
using system.runtime.interopservices dllimport user32 private static extern bool animatewindow intptr hwnd,int dwtime,int dwflags 下面是可用的常量,根據不同的動畫效果宣告...