如题,最好能提供源码,高手们请进!
解决方案 »
- 求救,Timer里处理键盘事件!
- 在继承A窗体下的B窗体 在B窗体中对控件拖拉很感觉控制不好,无法选取拉大或缩小
- 想学C#,希望大家指教!
- 有没有.net版的 类似Jabber(j2ee版)的IM服务器
- protected override void OnPaint(PaintEventArgs e)这个类是自己建的还是程序自动生成的啊?
- 请教一个 pictureBox缩放锚点计算公式
- 关于DragDrop和DragEnter事件
- 如何调用参数为函数指针的API?
- 请问C#中有没有现成的链表类?
- 哪位大哥愿意给我UML的电子书籍,高分相赠
- C#中如何使用全局缓冲区,而不被当作垃圾回收
- 调用dll文件问题 ~~~~~~~在线等
picturebox Drawing ;
添加 private void Drawing_MouseWheel(object sender, MouseEventArgs e)
{
double scale = 1;
if (Drawing.Height > 0)
{
scale = (double)Drawing.Width / (double)Drawing.Height;
}
if ((Drawing.Width > 200) && (e.Delta < 0))
{
Drawing.Width += (int)(e.Delta * scale);
Drawing.Height += e.Delta;
}
else if ((Drawing.Width < 1080) && (e.Delta>0))
{
Drawing.Width += (int)(e.Delta * scale);
Drawing.Height += e.Delta; }
}
{
double scale = 1;
if (Drawing.Height > 0)
{
scale = (double)Drawing.Width / (double)Drawing.Height;
}
if ((Drawing.Width > 200) && (e.Delta < 0))
{
Drawing.Width += (int)(e.Delta * scale);
Drawing.Height += e.Delta;
}
else if ((Drawing.Width < 1080) && (e.Delta>0))
{
Drawing.Width += (int)(e.Delta * scale);
Drawing.Height += e.Delta; }
}
pictureBox1.Location = new Point(pictureBox1.Location.X - 5, pictureBox1.Location.Y - 5);
pictureBox1.Size = new Size(pictureBox1.Size.Width + 5, pictureBox1.Size.Height + 5);写到某个事件中估计能用吧
自己添加,VS2005
{
int h = pictureBox1.Height;
int w= pictureBox1.Width ;
h = h * 2; w = w * 2;
pictureBox1.Height = h;
pictureBox1.Width = w;
}