当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > 建立永遠停留在最上層的窗口(VB)

ASP.NET
在图片上加入图片版权信息
Peer-to-Peer (P2P) communication across middleboxes(翻译4)
今天完成了.net compact framework 加 web service的演练.
Cordbg, Dumpbin, Ildasm, 的一些教程。
asp和asp.net的session共用
VB连接SQL数据库的模块
消除图片在ie中缓存而无法更新的问题
说说使用static和const关键字
怎样解决thephile中的数据库由于排序造成的问题:对 text 数据类型不支持代码页转...
.net分布式事务例子
Internet Explorer 编程简述(二)
使用SqlParameter参数返回值时遇到的问题
vb可不可以实现虚拟中断
C#下Socket对象的BeginReceive方法,执行后竟然不调用AsyncCallback里的回调函数
坚持学asp.net:(十一)
[C#][正则表达式]寻找匹配的Groups的几种方法
面向服务的体系结构概述
Windows Form 和 UserControl
VB中類模塊實現與C++中類實現的比較(1)
下载Oracle数据库中的Blob二进制文件,实例!

ASP.NET 中的 建立永遠停留在最上層的窗口(VB)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 42 ::
收藏到网摘: n/a

1.建立新的 [標準執行檔] 專案,根據預設值,隨即建立 Form1。 2.在 Form1 上加入兩個指令按鈕 (Command1 與 Command2)。 3.將 Command1 的標題 (Caption) 屬性設為「Always on top」。 4.將 Command2 的標題 (Caption) 屬性設為「Normal」。 5.將下面程式碼放入 Form1 的 [宣告] 區段中: Option Explicit Private Sub Command1_Click() Dim lR As Long lR = SetTopMostWindow(Form1.hwnd, True) End Sub Private Sub Command2_Click() Dim lR As Long lR = SetTopMostWindow(Form1.hwnd, False) End Sub6.在 [專案] 功能表上,按一下 [新增模組],在專案中加入新模組。 7.將下面程式碼加入新模組中: Option Explicit Public Const SWP_NOMOVE = 2 Public Const SWP_NOSIZE = 1 Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE Public Const HWND_TOPMOST = -1 Public Const HWND_NOTOPMOST = -2 Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" _ (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 Long Public Function SetTopMostWindow(hwnd As Long, Topmost As Boolean) _ As Long If Topmost = True Then 'Make the window topmost SetTopMostWindow = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, _ 0, FLAGS) Else SetTopMostWindow = SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, _ 0, 0,FLAGS) SetTopMostWindow = False End If End Function