mertugruul Posted April 24, 2015 Share Posted April 24, 2015 (edited) Merhaba. 2 tane pictureBox'ın var olduğunu düşünelim. pictureBox7 yukarıdan gelecek ve aşağıdaki pictureBox'a temas edince istediğim kodları çalıştırmak istiyorum. Aşağıdaki şu kod oluyor pic7 pic6'in üstüne geldiğinde ama bazen de 2 pictureBox birbirine değmediği halde yine aşağıdaki kod çalışıyor. if ((pictureBox7.Location.X + pictureBox7.Width >= pictureBox6.Location.X) && (pictureBox7.Location.Y + pictureBox7.Height >= pictureBox6.Location.Y)) { } Başka bir yol varmıdır bundan başka? Edited April 24, 2015 by mertugruul Quote Link to comment Share on other sites More sharing options...
Bitmap Posted April 24, 2015 Share Posted April 24, 2015 (edited) Rectangle.IntersectsWith() medotu ile sorunsuz kullanabilirsin. Bir zaman öyle kullanmıştım. (MSDN Sayfası) Kontrollün bulunduğu rectangle üzerinden işlem yapıyor. tüm kontrollerde kullanılabilir. kullanım şekli: if (pbImage7.Bounds.IntersectsWith(pbImage6.Bounds)) { // cakisma kodu gelecek. } Hala çalışıyosa eğer bu şekilde baya tutarlı oluyordu Edited April 24, 2015 by Bitmap Quote Link to comment Share on other sites More sharing options...
mertugruul Posted April 24, 2015 Author Share Posted April 24, 2015 Rectangle.IntersectsWith() medotu ile sorunsuz kullanabilirsin. Bir zaman öyle kullanmıştım. (MSDN Sayfası) Kontrollün bulunduğu rectangle üzerinden işlem yapıyor. tüm kontrollerde kullanılabilir. kullanım şekli: if (pbImage7.Bounds.IntersectsWith(pbImage6.Bounds)) { // cakisma kodu gelecek. } Hala çalışıyosa eğer bu şekilde baya tutarlı oluyordu İlaç gibi geldi. Sağolasın. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.