![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
Imports System.Text
Imports System.Runtime.InteropServices
<DllImport("user32.dll")> _
Function IsWindowEnabled(ByVal hWnd As IntPtr) As Boolean
End Function
Declare Function EnableWindow Lib "user32" (ByVal hwnd As Integer, ByVal fEnable As Integer) As Integer
If Not IsWindowEnabled(hwnd) Then
EnableWindow(hwnd, 1)
End If