菜鳥求助各路大神:
怎樣實作Vb.net創建無焦點表單,用于螢屏鍵盤?
uj5u.com熱心網友回復:
無焦點顯示沒問題,但是你點擊時還是會轉移焦點。Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function ShowWindow( _
ByVal hwnd As IntPtr, _
ByVal nCmdShow As Int32) As Boolean
End Function
Private Const SW_SHOWNOACTIVATE As Int32 = 4
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New Form2
ShowWindow(frm.Handle, SW_SHOWNOACTIVATE)
End Sub
End Class
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/113919.html
標籤:控件
