- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.Up:
if ((pictureBox1.Location.X + pictureBox1.Width >= pictureBox4.Location.X) & (pictureBox1.Location.X <= pictureBox4.Location.X + pictureBox4.Width) & (pictureBox1.Location.Y <= pictureBox4.Location.Y + pictureBox4.Height) & (pictureBox1.Location.Y >= pictureBox4.Location.Y + pictureBox4.Height / 2)) ;
else pictureBox1.Top -= 5;
if ((pictureBox2.Visible) & (pictureBox3.Visible))
if ((pictureBox1.Location.Y >= pictureBox2.Location.Y) & (pictureBox1.Location.Y + pictureBox1.Height <= pictureBox2.Location.Y + pictureBox2.Height) & (pictureBox1.Location.X >= pictureBox2.Location.X) & (pictureBox1.Location.X + pictureBox1.Width <= pictureBox2.Location.X + pictureBox2.Width))
pictureBox1.Location = new Point(pictureBox3.Location.X + (pictureBox1.Location.X - pictureBox2.Location.X), pictureBox3.Location.Y - 5);
if ((pictureBox2.Visible) & (pictureBox3.Visible))
if ((pictureBox1.Location.Y >= pictureBox3.Location.Y) & (pictureBox1.Location.Y + pictureBox1.Height <= pictureBox3.Location.Y + pictureBox3.Height) & (pictureBox1.Location.X >= pictureBox3.Location.X) & (pictureBox1.Location.X + pictureBox1.Width <= pictureBox3.Location.X + pictureBox3.Width))
pictureBox1.Location = new Point(pictureBox2.Location.X + (pictureBox1.Location.X - pictureBox3.Location.X), pictureBox2.Location.Y - 5);
break;
case Keys.Down:
if ((pictureBox1.Location.X + pictureBox1.Width >= pictureBox4.Location.X) & (pictureBox1.Location.X <= pictureBox4.Location.X + pictureBox4.Width) & (pictureBox1.Location.Y + pictureBox1.Height <= pictureBox4.Location.Y + pictureBox4.Height / 2) & (pictureBox1.Location.Y + pictureBox1.Height >= pictureBox4.Location.Y)) ;
else pictureBox1.Top += 5;
if ((pictureBox2.Visible) & (pictureBox3.Visible))
if ((pictureBox1.Location.Y >= pictureBox2.Location.Y) & (pictureBox1.Location.Y + pictureBox1.Height <= pictureBox2.Location.Y + pictureBox2.Height) & (pictureBox1.Location.X >= pictureBox2.Location.X) & (pictureBox1.Location.X + pictureBox1.Width <= pictureBox2.Location.X + pictureBox2.Width))
pictureBox1.Location = new Point(pictureBox3.Location.X + (pictureBox1.Location.X - pictureBox2.Location.X), (pictureBox3.Location.Y + pictureBox3.Height) - 5);
if ((pictureBox2.Visible) & (pictureBox3.Visible))
if ((pictureBox1.Location.Y >= pictureBox3.Location.Y) & (pictureBox1.Location.Y + pictureBox1.Height <= pictureBox3.Location.Y + pictureBox3.Height) & (pictureBox1.Location.X >= pictureBox3.Location.X) & (pictureBox1.Location.X + pictureBox1.Width <= pictureBox3.Location.X + pictureBox3.Width))
pictureBox1.Location = new Point(pictureBox2.Location.X + (pictureBox1.Location.X - pictureBox3.Location.X), (pictureBox2.Location.Y + pictureBox2.Height) - 5);
break;
Это не поддаётся описанию. Полная версия: http://pastebin.com/97sbSVLa
wvxvw 22.03.2012 16:25 # 0
roman-kashitsyn 22.03.2012 16:35 # 0
ling 22.03.2012 17:44 # +1
absolut 23.03.2012 10:31 # 0
eth0 22.03.2012 17:34 # 0
TheHamstertamer 22.03.2012 18:08 # 0
>Form1
>WindowsFormsApplication3
Мммм...
P4R4 22.03.2012 22:00 # −2
Отправлять каждый код сюда не имеет смысла. http://gordon.ucoz.com/publ
Lure Of Chaos 22.03.2012 22:49 # +2
P4R4 23.03.2012 08:42 # −1
Gordon 28.03.2012 19:37 # −2
Ну я же только начинаю)
Gordon 29.03.2012 18:13 # −4
eth0 30.03.2012 12:45 # 0
eth0 30.03.2012 12:45 # 0
Gordon 30.03.2012 13:20 # 0