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

هل يمكن اخفاء البار العلوي للاكسل ؟


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

السلام عليكم ورحمة الله وبركاته وطيب الله جمعتكم بخير

اخواني هل يمكن اخفاء البار العلوي للاكسل المحتوي على ازرار الاغلاق والتصغر  وجزاكم الله خير 

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

وعليكم السلام ورحمة الله وبركاته

أخي الكريم أبو راكان

ما الغرض من إخفاء هذا الشريط بالتحديد؟

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

أخي الكريم أبو راكان

إليك الكود التالي يتم وضعه في موديول عادي

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 GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowPos Lib "User32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function GetWindowRect Lib "User32" (ByVal hwnd As Long, lpRect As RECT) As Long

Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_SYSMENU = &H80000

Private Enum ESetWindowPosStyles
    SWP_SHOWWINDOW = &H40
    SWP_HIDEWINDOW = &H80
    SWP_FRAMECHANGED = &H20
    SWP_NOACTIVATE = &H10
    SWP_NOCOPYBITS = &H100
    SWP_NOMOVE = &H2
    SWP_NOOWNERZORDER = &H200
    SWP_NOREDRAW = &H8
    SWP_NOREPOSITION = SWP_NOOWNERZORDER
    SWP_NOSIZE = &H1
    SWP_NOZORDER = &H4
    SWP_DRAWFRAME = SWP_FRAMECHANGED
    HWND_NOTOPMOST = -2
End Enum

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Sub ShowTitleBar(bShow As Boolean)
    Dim lStyle As Long
    Dim tRect As RECT
    Dim xlHnd As Long

    xlHnd = Application.hwnd
    GetWindowRect xlHnd, tRect

    If Not bShow Then
        lStyle = GetWindowLong(xlHnd, GWL_STYLE)
        lStyle = lStyle And Not WS_SYSMENU
        lStyle = lStyle And Not WS_MAXIMIZEBOX
        lStyle = lStyle And Not WS_MINIMIZEBOX
        lStyle = lStyle And Not WS_CAPTION
    Else
        lStyle = GetWindowLong(xlHnd, GWL_STYLE)
        lStyle = lStyle Or WS_SYSMENU
        lStyle = lStyle Or WS_MAXIMIZEBOX
        lStyle = lStyle Or WS_MINIMIZEBOX
        lStyle = lStyle Or WS_CAPTION
    End If

    SetWindowLong xlHnd, GWL_STYLE, lStyle

    Application.DisplayFullScreen = Not bShow
    SetWindowPos xlHnd, 0, tRect.Left, tRect.Top, tRect.Right - tRect.Left, tRect.Bottom - tRect.Top, SWP_NOREPOSITION Or SWP_NOZORDER Or SWP_FRAMECHANGED
End Sub

Sub Hide_Application_Title()
    ShowTitleBar False
End Sub

Sub Show_Application_Title()
    ShowTitleBar True
End Sub

يمكنك تنفيذ إخفاء شريط العنوان باستدعاء الماكرو المسمى Hide_Application_Title ولاظهار العنوان مرة أخرى استدعي الماكرو المسمى Show_Application_Title

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

استاذي العزيز اسال الله ان يوفقك ويرزقك ويزيدك علما

اما الغرض فهو لاتساع مساحة العمل وكذلك كشكل جمالي للمستند

واما بالنسبة للكود فلا يعمل لان نظامي 64 بت 

قاتله الله من نظام فقد حرمني الكثير من الملفات المفيدة

واولا واخر لك خالص الدعوات بظهر الغيب استاذنا 

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

أخي الكريم ابو راكان

لا تدعو على النظام الذي أعمل عليه ...فأنا الآن صرت من عشاق هذا النظام الرائع والسريع جداً في التعامل مع نظام التشغيل والجهاز لأنه يستغل إمكانيات الجهاز بالكامل

وكل مشكلة ولها حل إن شاء ربي

إليك التعديل التالي ليوافق العمل على نظام 64 بت

#If VBA7 Then
    Private Declare PtrSafe Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Declare PtrSafe Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hwnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare PtrSafe Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hwnd As LongPtr, ByVal nIndex As Long) As Long
    Private Declare PtrSafe Function SetWindowPos Lib "User32" (ByVal hwnd As LongPtr, ByVal hWndInsertAfter As LongPtr, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    Private Declare PtrSafe Function GetWindowRect Lib "User32" (ByVal hwnd As LongPtr, lpRect As RECT) As Long
#Else
    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 GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowPos Lib "User32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    Private Declare Function GetWindowRect Lib "User32" (ByVal hwnd As Long, lpRect As RECT) As Long
#End If

Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_SYSMENU = &H80000

Private Enum ESetWindowPosStyles
    SWP_SHOWWINDOW = &H40
    SWP_HIDEWINDOW = &H80
    SWP_FRAMECHANGED = &H20
    SWP_NOACTIVATE = &H10
    SWP_NOCOPYBITS = &H100
    SWP_NOMOVE = &H2
    SWP_NOOWNERZORDER = &H200
    SWP_NOREDRAW = &H8
    SWP_NOREPOSITION = SWP_NOOWNERZORDER
    SWP_NOSIZE = &H1
    SWP_NOZORDER = &H4
    SWP_DRAWFRAME = SWP_FRAMECHANGED
    HWND_NOTOPMOST = -2
End Enum

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Sub ShowTitleBar(bShow As Boolean)
    Dim lStyle As Long
    Dim tRect As RECT
    Dim xlHnd As Long
    
    xlHnd = Application.hwnd
    GetWindowRect xlHnd, tRect
    
    If Not bShow Then
        lStyle = GetWindowLong(xlHnd, GWL_STYLE)
        lStyle = lStyle And Not WS_SYSMENU
        lStyle = lStyle And Not WS_MAXIMIZEBOX
        lStyle = lStyle And Not WS_MINIMIZEBOX
        lStyle = lStyle And Not WS_CAPTION
    Else
        lStyle = GetWindowLong(xlHnd, GWL_STYLE)
        lStyle = lStyle Or WS_SYSMENU
        lStyle = lStyle Or WS_MAXIMIZEBOX
        lStyle = lStyle Or WS_MINIMIZEBOX
        lStyle = lStyle Or WS_CAPTION
    End If
    
    SetWindowLong xlHnd, GWL_STYLE, lStyle
    
    Application.DisplayFullScreen = Not bShow
    SetWindowPos xlHnd, 0, tRect.Left, tRect.Top, tRect.Right - tRect.Left, tRect.Bottom - tRect.Top, SWP_NOREPOSITION Or SWP_NOZORDER Or SWP_FRAMECHANGED
End Sub

Sub Hide_Application_Title()
    ShowTitleBar False
End Sub

Sub Show_Application_Title()
    ShowTitleBar True
End Sub

 

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

السلام عليكم و رحمة الله وبركاته

بعد اذن اخي الحبيب و الأستاذ القدير ابو البراء

 

هذا حل آخر

بتفعيل عرض ملء الشاشة

Sub Macro1()
    Application.DisplayFullScreen = True
End Sub
Sub Macro2()
    Application.DisplayFullScreen = False

End Sub

 

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

جميل أخي الحبيب أحمد

ولكن في أصل الموضوع أنه يريد إخفاء شريط العنوان الذي يحوي ازرار التصغير والإغلاق .. أما السطر الخاص بكتبير الشاشة يخفي الكثير ما عدا شريط العنوان

وإن كنت أفضل حلك لأنه يتسم بالبساطة وعدم التعقيد .. ويؤدي بنسبة كبيرة المطلوب أيضاً

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

السلام عليكم

ان كان كجمال واعطاء مساحه احبذ الكود التالي

عند فتح المصنف "Auto_Open" ينفذ اخفاء

عند اغلاق المصنف "Auto_Close" ينفذ اظهار

Sub Auto_Open()
  Ali_Acc False
End Sub
Sub Auto_Close()
  Ali_Acc True
End Sub
Sub Ali_Acc(Bll As Boolean)
  With Application
      .DisplayFormulaBar = Bll
      .ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"" ," & Bll & ")"
      .ActiveWindow.DisplayHeadings = Bll
      If Bll Then .ThisWorkbook.Close SaveChanges:=Not Bll
  End With
End Sub

 

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

حفظك الله اخي ياسر خليل

كلنا نتعلم من بعض 

   احبك الله الذي احببتنا فيه

تقبل تحياتي وشكري لشخصكم النبيل

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

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