469,623 Members | 1,422 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

How to put value in a System.Drawing.Point object?

Need Help with

System.Drawing.Point b = new System.Drawing.Point(int x , int y)

I want to move a window when mous is down and mous is moving

private void label1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left && video.Fullscreen != true)
{
System.Drawing.Point b = new
System.Drawing.Point(outputposx-mouseposx+MediaOutForm.MousePosition.X,
outputposy-mouseposy+MediaOutForm.MousePosition.Y);
output.Location = b;
}
}

It works but isnt it so that it generates objects of type Point every time
when mouse is moved?
I want to declare
System.Drawing.Point b = new System.Drawing.Point();
in the Class and want only put the values in the Mouse_Move event.
But how can I put values into b (Point object??)

Thx
Nov 16 '05 #1
1 6669
Have found the solution
I can add value to it via

b.X = 100;
b.Y = 100;

"Bilo" <ju********@yahoo.com> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP10.phx.gbl...
Need Help with

System.Drawing.Point b = new System.Drawing.Point(int x , int y)

I want to move a window when mous is down and mous is moving

private void label1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left && video.Fullscreen != true)
{
System.Drawing.Point b = new
System.Drawing.Point(outputposx-mouseposx+MediaOutForm.MousePosition.X,
outputposy-mouseposy+MediaOutForm.MousePosition.Y);
output.Location = b;
}
}

It works but isnt it so that it generates objects of type Point every time
when mouse is moved?
I want to declare
System.Drawing.Point b = new System.Drawing.Point();
in the Class and want only put the values in the Mouse_Move event.
But how can I put values into b (Point object??)

Thx

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Steve Amey | last post: by
reply views Thread by BeeFirst | last post: by
4 posts views Thread by Liverpool fan | last post: by
7 posts views Thread by pooba53 | last post: by
6 posts views Thread by Derek Hart | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.