منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : كتابة هذا الكود الى السي شارب
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
اريد اتاية هذا الكود الي بالمشاركة التالية الى السي شارب


قمت بتحويله لكن به خطء

كود :
private void Button1_Click(object sender, EventArgs e)
{
        var rc = PictureBox1.RectangleToScreen(new Rectangle(Point.Empty, PictureBox1.ClientSize));
        Cursor.Position = new Point(rc.Left + rc.Width / 2.0, rc.Top + rc.Height / 2.0);
        Cursor.Clip = rc;
        PictureBox1.Capture = true;
    }
اتمنى من الاخوة التصحيح
السلام عليكم اخي الكريم
تفضل هذا هو الكود بالسي شارب 
كود :
private void button1_Click(object sender, EventArgs e)
       {
        var rc = pictureBox1.RectangleToScreen(new Rectangle(Point.Empty, pictureBox1.ClientSize));
       Cursor.Position = new Point(Convert.ToInt32(rc.Left + rc.Width / 2.0), Convert.ToInt32(rc.Top + rc.Height / 2.0));
        Cursor.Clip = rc;
        pictureBox1.Capture = true;
    
       }

(13-02-19, 12:28 PM)ابراهيم ايبو كتب : [ -> ]
السلام عليكم اخي الكريم
تفضل هذا هو الكود بالسي شارب 
كود :
private void button1_Click(object sender, EventArgs e)
       {
        var rc = pictureBox1.RectangleToScreen(new Rectangle(Point.Empty, pictureBox1.ClientSize));
       Cursor.Position = new Point(Convert.ToInt32(rc.Left + rc.Width / 2.0), Convert.ToInt32(rc.Top + rc.Height / 2.0));
        Cursor.Clip = rc;
        pictureBox1.Capture = true;
    
       }

شكرا اخي
الله يحفظك
الحمد لله والشكر لله
ويحفظك الله اخي الكريم