帮忙看看下面这个C#程序 - .NET技术 / C#
private void Form1_Load(object sender, EventArgs e)
{
}
private void btnCatchMe_Click(object sender, EventArgs e)
{
MessageBox.Show("抓到我了,真厉害!", "抓到了", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void MainForm_MouseMove(object sender, MouseEventArgs e)
{
const int BORDER =50;
const int SPACE = 20;
int x = e.X;
int y = e.Y;
int left = btnCatchMe.Left;
int right = btnCatchMe.Right;
int top = btnCatchMe.Top;
int bottom = btnCatchMe.Bottom;
if (x > left - BORDER && x < right + BORDER && y > top - BORDER && y < bottom + BORDER)
{
btnCatchMe.Top += y > top ? -SPACE : SPACE;
if (btnCatchMe.Top < 0 || btnCatchMe.Bottom > this.Height)
{
btnCatchMe.Top = this.Height / 2;
}
btnCatchMe.Left += x > left ? -SPACE : SPACE;
if (btnCatchMe.Left < 0 || btnCatchMe.Right > this.Width)
相关问答:
思路:要用c#生成一个播放机的播放列表的xml,例如:
<daty datys='2010-04-05' datye='2010-05-01' > //这是播放的日期段
<time times='01:12:00' timee='02:30:00'> ......
挺繁琐,之前发的帖子,分值太低现在重发一个。欢迎各位大侠~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[] ......
使用ACCESS最大的隐患就是不安全。今天对ACCESS数据库设置了一个密码,必须使用密码才能打开,但是在程序中却无法连接数据库了。大家知道使用用户名和密码,如何连接ACCESS数据库?貌似ACCESS的用户名还不知道?只知 ......
求一本C#设计模式的书 ,我感觉我的代码运用接口,委托,属性的地方很少,肯定是我的设计模式太差了 ,有没有这方面,从国外翻译过来的,比较好的设计模式的书,推荐一下吧,非常感谢.
高人们说 代码重构的书好些,那我要改看 ......