.net 窗体清除上次显示的内容_access在系统右下角任务栏弹出消息提示窗体
生活随笔
收集整理的這篇文章主要介紹了
.net 窗体清除上次显示的内容_access在系统右下角任务栏弹出消息提示窗体
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
在日常工作中,我們希望程序有提示功能。在某個(gè)時(shí)間點(diǎn)或者預(yù)設(shè)值提示信息
在Windows操作系統(tǒng)中,我們常常可以看到某軟件會(huì)在右下角自動(dòng)彈出消息供參考閱讀
在access中,我們也可以通過(guò)API函數(shù)來(lái)判斷系統(tǒng)狀態(tài)欄的位置,讓窗體在右下角任務(wù)欄向上滑動(dòng)彈出
API函數(shù):
Option Compare Database'調(diào)用API取得除任務(wù)欄外的屏幕高度Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As LongPublic Const SPI_GETWORKAREA = 48Public Type RECT Left As Long Top As Long Right As Long Bottom As LongEnd Type'調(diào)用API得到整個(gè)屏幕高度Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As LongPrivate Const SM_CXSCREEN = 0Private Const SM_CYSCREEN = 1Public Function GetSystemHeight() As Integer '取得屏幕高度 GetSystemHeight = GetSystemMetrics(SM_CYSCREEN)End FunctionPublic Function GetTaskbarHeight() As Integer '取得任務(wù)欄高度 Dim lRes As Long Dim rectVal As RECT lRes = SystemParametersInfo(SPI_GETWORKAREA, 0, rectVal, 0) GetTaskbarHeight = GetSystemMetrics(SM_CYSCREEN) - rectVal.BottomEnd Function窗體中代碼:
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As LongPrivate Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As LongDim mywidth As Long, myheight As Long'設(shè)置窗口總在最前Const SWP_NOSIZE = &H1Const SWP_NOMOVE = &H2Const HWND_TOP = 0Const HWND_NOTOPMOST = -2Const HWND_BOTTOM = 1Const HWND_TOPMOST = -1Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As LongPrivate Sub Form_Load()'在任務(wù)欄中不顯示 hdc = GetDC(0) mywidth = GetDeviceCaps(hdc, 8) myheight = GetDeviceCaps(hdc, 10) DoCmd.MoveSize (mywidth * 15 - Me.WindowWidth),GetSystemHeight * 15 '窗口總在最前 SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Me.TimerInterval = 200End SubPrivate Sub Form_Timer() Dim I As Integer For I = GetSystemHeight * 15 To (myheight * 15 - Me.WindowHeight) - GetTaskbarHeight * 15 Step -1 DoCmd.MoveSize (mywidth * 15 - Me.WindowWidth), I Next I Me.TimerInterval = 0End Sub滑出過(guò)程:
學(xué)習(xí)更多的access技巧源碼,請(qǐng)關(guān)注office交流網(wǎng):http://www.office-cn.net
總結(jié)
以上是生活随笔為你收集整理的.net 窗体清除上次显示的内容_access在系统右下角任务栏弹出消息提示窗体的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 随机森林做特征重要性排序和特征选择
- 下一篇: gtw-050090|执行拦截器时发生异