471,863 Members | 1,009 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,863 software developers and data experts.

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 6926
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
NeoPa
reply views Thread by NeoPa | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.