اذهب الي المحتوي
أوفيسنا

إخفاء زر الإغلاق في الفورم


إذهب إلى أفضل إجابة Solved by الصـقر,

الردود الموصى بها

تفضل اخى الحبيب

ضع هذا الكود فى الفورم

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
Const GWL_STYLE = -16
Const WS_SYSMENU = &H80000

Private Sub UserForm_Initialize()
   Dim hWnd As Long, lStyle As Long
   If Val(Application.Version) >= 9 Then
   hWnd = FindWindow("ThunderDFrame", Me.Caption)
   Else
   hWnd = FindWindow("ThunderXFrame", Me.Caption)
   End If
   lStyle = GetWindowLong(hWnd, GWL_STYLE)
   SetWindowLong hWnd, GWL_STYLE, (lStyle And Not WS_SYSMENU)
End Sub

تقبل تحياتى

  • Like 1
رابط هذا التعليق
شارك

  • أفضل إجابة

اخى الحبيب 

يوضع هذا الجزء فى بداية اكواد الفورم

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
Const GWL_STYLE = -16
Const WS_SYSMENU = &H80000

ثم يوضع هذا الجزء مستقل

Private Sub UserForm_Initialize()
   Dim hWnd As Long, lStyle As Long
   If Val(Application.Version) >= 9 Then
   hWnd = FindWindow("ThunderDFrame", Me.Caption)
   Else
   hWnd = FindWindow("ThunderXFrame", Me.Caption)
   End If
   lStyle = GetWindowLong(hWnd, GWL_STYLE)
   SetWindowLong hWnd, GWL_STYLE, (lStyle And Not WS_SYSMENU)
End Sub

اخفاء زر الخروج.zip

  • Like 2
رابط هذا التعليق
شارك

من فضلك سجل دخول لتتمكن من التعليق

ستتمكن من اضافه تعليقات بعد التسجيل



سجل دخولك الان
×
×
  • اضف...

Important Information