تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
كيف اجعل ادوات شفافه
#1
السلام عليكم

اود اعرف كيف اجعل الادوات شفافه

اداة البتون
والتكست بوكس

والادوات الاخرى

بارك الله فيكم
الرد }}}
تم الشكر بواسطة:
#2
هذا كود لاخفاء الفورم واظهار الادوات الموجوده فيه ان شاء الله تستفيد منها

PHP كود :
Option Explicit
    
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As LongByVal Y1 As LongByVal X2 As LongByVal Y2 As Long) As Long
    
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As LongByVal hSrcRgn1 As LongByVal hSrcRgn2 As LongByVal nCombineMode As Long) As Long
    
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As LongByVal hRgn As LongByVal bRedraw As Boolean) As Long
    
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
    
' Constants used by the CombineRgn function
    Private Const RGN_AND = 1
    Private Const RGN_OR = 2
    Private Const RGN_XOR = 3
    Private Const RGN_DIFF = 4
    Private Const RGN_COPY = 5

Private Sub Form_Activate()
    Dim rgnForm As Long, rgnCombined As Long
    Dim rgnControl As Long, x As Long
    Dim formWidth As Single, formHeight As Single
    Dim borderWidth As Single, titleHeight As Single
    Dim ctlLeft As Single, ctlTop As Single
    Dim ctlWidth As Single, ctlHeight As Single
    Dim ctl As Control
    ' 
Calculate the form area
    borderWidth 
= (Me.Width Me.ScaleWidth) / 2
    titleHeight 
Me.Height Me.ScaleHeight borderWidth
    
' Convert to Pixels
    borderWidth = ScaleX(borderWidth, vbTwips, vbPixels)
    titleHeight = ScaleY(titleHeight, vbTwips, vbPixels)
    formWidth = ScaleX(Me.Width, vbTwips, vbPixels)
    formHeight = ScaleY(Me.Height, vbTwips, vbPixels)
    ' 
Create a region for the whole form
    rgnForm 
CreateRectRgn(00formWidthformHeight)
    
rgnCombined CreateRectRgn(0000)
    
' Make the graphical area transparent by combining the two regions
    x = CombineRgn(rgnCombined, rgnForm, rgnForm, RGN_DIFF)
    ' 
Make the controls visible
    
For Each ctl In Controls
        
' Make the regions of controls whose container is the form visible
        If TypeOf ctl.Container Is Form Then
            ctlLeft = ScaleX(ctl.Left, vbTwips, vbPixels) + borderWidth
            ctlTop = ScaleX(ctl.Top, vbTwips, vbPixels) + titleHeight
            ctlWidth = ScaleX(ctl.Width, vbTwips, vbPixels) + ctlLeft
            ctlHeight = ScaleX(ctl.Height, vbTwips, vbPixels) + ctlTop
            rgnControl = CreateRectRgn(ctlLeft, ctlTop, ctlWidth, ctlHeight)
            x = CombineRgn(rgnCombined, rgnCombined, rgnControl, RGN_OR)
        End If
    Next ctl
    ' 
Set the clipping area of the window using the resulting region
    SetWindowRgn hWnd
rgnCombinedTrue
    
' Tidy up
    x = DeleteObject(rgnCombined)
    x = DeleteObject(rgnControl)
    x = DeleteObject(rgnForm)
End Sub 
الرد }}}
تم الشكر بواسطة:
#3
وهذا كود لجعل الفورم شفاف والادوات الموجوده فيه شفافه

PHP كود :
Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hwnd As LongByValcrKey As LongByVal bAlpha As ByteByVal dwFlags As Long) As Boolean
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As LongByVal nIndex As LongByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As LongByVal nIndex As Long) As Long
Const LWA_ALPHA 2
Const GWL_EXSTYLE = (-20)
Const 
WS_EX_LAYERED = &H80000

Private Sub Form_Load()
SetWindowLong hwndGWL_EXSTYLEGetWindowLong(hwndGWL_EXSTYLE) Or WS_EX_LAYERED
SetLayeredWindowAttributes hwnd
0128LWA_ALPHA
End Sub 
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  كيف اجعل الكتابة من اليمين الى اليسار والعكس بالكود؟ imatawen 4 2,989 04-09-23, 12:14 PM
آخر رد: Nasa_use
  [vb6.0] كيف اجعل المستخدم التعديل على الأرقام في text1 فقط ولا يمكن مسحها ؟ Microformt 2 1,390 18-12-21, 01:41 PM
آخر رد: اسلام الكبابى
  [سؤال] مشكله مع ادوات ocx على وندوز 8.1 Visual_Basic 6 2,765 27-11-17, 01:38 PM
آخر رد: Ashraf Elafify
  كيف اجعل chek box في data gred hamada666 7 3,220 20-08-13, 10:35 AM
آخر رد: hamada666
  كيف اجعل text يخذ خاصية MaskEdBox ؟؟ softmail8 6 3,052 31-07-13, 12:54 PM
آخر رد: softmail8
  ازاى اجعل التكست يقبل الرموز مثل "۞" ولا يحولها الى علامات ؟؟ Yasso 13 4,814 29-07-13, 04:50 AM
آخر رد: Yasso
  كيف اجعل إدارة ProgressBar1 يتحرك بناً على حجم قاعدة البيانات عند عمل نسخه احتياطيه ؟؟ softmail8 0 1,651 25-06-13, 04:52 PM
آخر رد: softmail8
  كيف اجعل برنامجي المرفق عند اخر سجل يظهر لمستخدم انه في اخر سجل تم عرضه ؟؟ softmail8 2 2,122 18-06-13, 08:04 PM
آخر رد: softmail8
  اجعل الـــ Form على شكل صورة VBMaged 6 2,946 02-06-13, 12:50 PM
آخر رد: samee119485r
  كيف اجعل المستخدم إغلاق الفوم ب chift+ctrl+F2 من لوحة المفاتيح ؟؟ softmail8 3 2,154 24-05-13, 06:59 PM
آخر رد: algroob

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم