تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
حذف أطراف الكنترول (Bordures)
#1
كاتب الموضوع : Boutemine Oualid

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

كود :
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal HWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal HWnd As Long, lpRect As Rectangle) As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal HWnd As Long, lpPoint As Point) As Long
Private Type Point
X As Long
Y As Long
End Type
Private Type Rectangle
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub RemoveControlBorder(HWnd As Long, Optional BorderSize As Long = 3)
Dim Rgn As Long
Dim Rect As Rectangle
Call GetWindowRect(HWnd, Rect)
Dim Size As Point
Size.X = Rect.Right
Size.Y = Rect.Bottom
Call ScreenToClient(HWnd, Size)
Rgn = CreateRectRgn(BorderSize, BorderSize, Size.X - BorderSize, Size.Y - BorderSize)
Call SetWindowRgn(HWnd, Rgn, True)
Call DeleteObject(Rgn)
End Sub
Private Sub Form_Load()
Call RemoveControlBorder(Command1.HWnd)
Call RemoveControlBorder(List1.HWnd)
End Sub
}}}}
تم الشكر بواسطة:


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


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