.Net WinForms当具有AllowTransparency = true时,使用SendMessage(... WM_SETREDRAW ..)暂停表单布局的意外行为,隐藏了表单

时间:2018-07-13 11:29:09

标签: winforms transparency sendmessage

具有以下形式:

Me.AllowTransparency = True
Me.BackColor = Color.Magenta
Me.TransparencyKey = Me.BackColor

并且正在做

SendMessage(pForm.Handle, WM_SETREDRAW, New IntPtr(CInt(False)), IntPtr.Zero)

隐藏表格,没有透明效果,效果很好……

有解决方法吗?真正暂停布局的另一种方法?

定义:

Private Const WM_SETREDRAW As Int32 = &HB
Private Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr

使用Win10(1803)。

0 个答案:

没有答案