یکی از دوستان خواسته بودید علامت ضربدر بالای فرم را چطوری میشه برداشت که تو فایل زیر این مورد و موارد دیگه آورده شده ( فکر کنم قبلا تو انجمن فایلش گذاشته شده باشه ولی من پیدا نکردمش که لینک بدم اگه تکراری بود شرمنده
)

Private Sub UserForm_Initialize() Call RemoveTitleBar(Me) End Sub
Option Explicit Private Declare Function FindWindow Lib "User32" _ Alias "FindWindowA" ( _ ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Private Declare Function GetWindowLong Lib "User32" _ Alias "GetWindowLongA" ( _ ByVal hwnd As Long, _ ByVal nIndex As Long) 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 Sub RemoveTitleBar(frm As Object) Dim lStyle As Long Dim hMenu As Long Dim mhWndForm As Long If Val(Application.Version) < 9 Then mhWndForm = FindWindow("ThunderXFrame", frm.Caption) 'for Office 97 version Else mhWndForm = FindWindow("ThunderDFrame", frm.Caption) 'for office 2000 or above End If lStyle = GetWindowLong(mhWndForm, -16) lStyle = lStyle And Not &HC00000 SetWindowLong mhWndForm, -16, lStyle DrawMenuBar mhWndForm End Sub Sub ShowForm() UserForm.Show False End Sub
Private m_sngDownX As Single Private m_sngDownY As Single Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If Button = 1 Then m_sngDownX = X m_sngDownY = Y End If End Sub Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If Button And 1 Then Me.Left = Me.Left + (X - m_sngDownX) Me.Top = Me.Top + (Y - m_sngDownY) End If End Sub
کامنت