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

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


كود :
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
private static extern IntPtr CreateRectRgn(int X1, int Y1, int X2, int Y2);
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern IntPtr SetWindowRgn(IntPtr hwnd, IntPtr hRgn, bool bRedraw);
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
private static extern IntPtr DeleteObject(IntPtr hObject);
private static void RemoveControlBorder(System.Windows.Forms.Control Ctrl, int BorderSize) {
IntPtr Rgn = CreateRectRgn(BorderSize, BorderSize, Ctrl.Width - BorderSize, Ctrl.Height - BorderSize); SetWindowRgn(Ctrl.Handle, Rgn,
true);
DeleteObject(Rgn);
}
private void Form1_Load(object sender, EventArgs e) {
RemoveControlBorder(this.button1, 3);
}
فيبي نت

كود :
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As IntPtr
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As IntPtr, ByVal hRgn As IntPtr, ByVal bRedraw As Boolean) As IntPtr
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As IntPtr) As IntPtr
Private Sub RemoveControlBorder(ByVal Ctrl As System.Windows.Forms.Control, Optional ByVal BorderSize As Integer = 3)
Dim Rgn As IntPtr = CreateRectRgn(BorderSize, BorderSize, Ctrl.Width - BorderSize, Ctrl.Height - BorderSize)
Call SetWindowRgn(Ctrl.Handle, Rgn, True)
Call DeleteObject(Rgn)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
RemoveControlBorder(Me.Button1)
End Sub
}}}
تم الشكر بواسطة:


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


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