lady_alina
Board Regular
- Joined
- Feb 18, 2015
- Messages
- 52
Hi,
I have a user form where I have used the below code to remove the title bar but the problem is the unload me sub doesn't work. Can somebody help with the code for user form load me button. Also if soembody can help me with the code to auto populate some of the text boxes based on the combo box.
I have a user form where I have used the below code to remove the title bar but the problem is the unload me sub doesn't work. Can somebody help with the code for user form load me button. Also if soembody can help me with the code to auto populate some of the text boxes based on the combo box.
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long _
, ByVal dwNewLong As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" _
(ByVal hWnd As Long) As Long
Code:
Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hWnd, -16, &H84080080&
DrawMenuBar hWnd
End Sub