النتائج 1 إلى 3 من 3

الموضوع: سؤال عن الأداة imagebox

  1. #1
    التسجيل
    08-09-2005
    المشاركات
    3

    سؤال عن الأداة imagebox

    كيف أستطيع أن أجعل خلفية الأداة imagebox شفافة أي أن الخلفية لا تظهر بيضاء بل يظهر ما ورائها

  2. #2
    التسجيل
    03-08-2004
    الدولة
    تركيا
    المشاركات
    3,755

    مشاركة: سؤال عن الأداة imagebox

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

    imagebox لايمكن ابدا جعلها شفافة لعدم وجود back color و hawd
    كل الادوات يمكن جعلها شفافة انسخ هذه الاكواد وقم بتغيير ما تريد منها


    Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Private Declare Function ReleaseCapture Lib "user32" () As Long
    Private Const WM_SYSCOMMAND = &H112&
    Private Const SC_MOVE = &HF010&
    Private Const WM_NCLBUTTONDOWN = &HA1
    Private Const HTCAPTION = 2
    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 Const GWL_STYLE = (-16)
    Private Const GWL_EXSTYLE = (-20)
    Private Const WS_EX_LAYERED = &H80000
    Private Type BLENDFUNCTION
    BlendOp As Byte
    BlendFlags As Byte
    SourceConstantAlpha As Byte
    AlphaFormat As Byte
    End Type

    Private Const AC_SRC_OVER = &H0
    Private Const AC_SRC_ALPHA = &H1
    Private Const AC_SRC_NO_PREMULT_ALPHA = &H1
    Private Const AC_SRC_NO_ALPHA = &H2
    Private Const AC_DST_NO_PREMULT_ALPHA = &H10
    Private Const AC_DST_NO_ALPHA = &H20
    Private Declare Function SetLayeredWindowAttributes Lib "user32" _
    (ByVal hwnd As Long, ByVal crKey As Long, _
    ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
    Private Const LWA_COLORKEY = &H1
    Private Const LWA_ALPHA = &H2
    Private Declare Function UpdateLayeredWindow Lib "user32" _
    (ByVal hwnd As Long, ByVal hdcDst As Long, pptDst As Any, _
    psize As Any, ByVal hdcSrc As Long, _
    pptSrc As Any, crKey As Long, _
    ByVal pblend As Long, ByVal dwFlags As Long) As Long
    Private Const ULW_COLORKEY = &H1
    Private Const ULW_ALPHA = &H2
    Private Const ULW_OPAQUE = &H4
    Private Declare Function RedrawWindow Lib "user32" (ByVal hwnd As Long, lprcUpdate As Any, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
    Private Const RDW_ALLCHILDREN = &H80
    Private Const RDW_ERASE = &H4
    Private Const RDW_FRAME = &H400
    Private Const RDW_INVALIDATE = &H1

    هذا اجعله في زر او غيره
    Dim transColor As Long
    transColor = &H8000FF
    Me.BackColor = transColor

    Dim lStyle As Long
    lStyle = GetWindowLong(hwnd, GWL_EXSTYLE)
    lStyle = lStyle Or WS_EX_LAYERED
    SetWindowLong hwnd, GWL_EXSTYLE, lStyle

    SetLayeredWindowAttributes Me.hwnd, transColor, 255, LWA_COLORKEY Or LWA_ALPHA

    خلفية الفورم الان شفافة غير me الى pic او combo او text او list
    وغيرها وشكرا

  3. #3
    التسجيل
    08-09-2005
    المشاركات
    3

    مشاركة: سؤال عن الأداة imagebox



    يعطيك العافية...................وشكراً على الرد




ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •