اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

مساعدة في Userforme


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

السلام عليكم

تفضل هذا الكود

يدرج في حدث الفورم


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

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)

Cancel = (CloseMode = 0)

End Sub

قبل تفعيل الفورم لاتنسى تضيف زر لإخفاء الفورم مثلا ليبل هكذا

Private Sub Label1_Click()

ME.Hide

End Sub

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

يمكن الاكتفاء بهذا لالغاءه دون حذفه


Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)

Cancel = (CloseMode = 0)

End Sub

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

السلام عليكم

الاستاذ عبدالله الحبيب

بالنسبة للكود المختصر في حدث اغلاق الفورم

يقوم بالغاء تفعيل الزر ولا يخفية

للمعلومية فقط

تقبل تحياتي وشكري

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information