|
At least he's making sure he phrased his question correctly. Many of the people that post here don't care, or are completely incapable of posting a correctly phrased question..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Many of the people that post here don't care, or are completely incapable of posting a correctly phrased question.
This is true, unfortunately.
|
|
|
|
|
Guys I'm being very sincere in this post. I'm just asking am I using the right terminology in describing my issue, that's it. I'm not trying to be tricky in trying to get my orig post answered.
I was at Barnes and Nobles yesterday reading "Coders at Work" by Peter Seibel which talks about what certain great coders practices are like. One of the take aways from the book is good communication. Which got me thinking, am I using the right terminology in describing my issues(posts)?
I just want to know can you understand what I'm trying to convey? Which no one has answered yet. lol
DotNetMan
|
|
|
|
|
There wasn't anything wrong with your terminology, at least as far as I was concerned.
Keep in mind though, that communication isn’t just your ability to accurately describe what you need to get across but also to comprehend what others are trying to communicating to you.
|
|
|
|
|
It would seem that what I really want to do is move around a child form based on mouse coordinates and keep the focus on the parent form. The movement of the child form would be referenced to the cursor. Any guidence would be appreciated.
|
|
|
|
|
OK I've figured this out. Thanks.
|
|
|
|
|
The proper response should have been to include the solution so anyone with a similar issue could see it as well. Short of that, since no one had responded delete the post, which you can't do now. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
how can i create Documentation for SQL server Database ?(like access )
|
|
|
|
|
Use NotePad
What type of documentation are you referring to? I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Something like :
Tools--->analyze---->Documenter in ACCESS Database modified on Saturday, March 13, 2010 1:06 PM
|
|
|
|
|
|
I got conversion from lat/long to georef(x and y coordinates) in this site itself. But did not get from lat/long to mils...
|
|
|
|
|
You already posted question and this one is still linked to that post, so post there.
|
|
|
|
|
I'm having trouble figuring this out. I want to move around a form using mouse coordinates, much like a tooltip moves with the cursor. In other words I want the form to maintain a fixed relative position to the cursor. Any help would be much appreciated.
|
|
|
|
|
That is eazy.
Use MouseMove event and calculate the difrance betwen previous saved position and current mouse position. After that, handle Form.Location in orther to change position.
|
|
|
|
|
I had thought I could do something like this but I just get a flickering mess?
void Form1_MouseMove(object sender, MouseEventArgs e)
{
this.Location = new Point(e.X, e.Y);
}
|
|
|
|
|
The problem with this code is, that Location is screen based cordinate and e.x, e.y are client based cordinates.
it gees like this:
private int x;
private int y;
private bool first = true;
void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (first)
{
x=e.X;
y=e.Y;
return;
}
int aX = x-e.X;
int aY = y-e.Y;
this.Location = new Point(this.Location.X-aX, this.Location.Y-aY);
x = e.X;
y = e.Y;
}
for flickering issue try setting Double Buffer.
this.SetStyle(
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer, true);
ps: I am coding from memory without actualy testing for errors
|
|
|
|
|
Thanks, but is it possible to move the form with the cursor when its not over the form? Woulkd it be easier if I was moving a child form within the area of a parent form, and how would I communication the mousemove events to the child form?
|
|
|
|
|
|
Thank you very much for your help. Here is the completed working code.
private int x;
private int y;
private int aX;
private int aY;
[DllImport("user32.dll")]
static extern bool GetCursorPos(ref Point lpPoint);
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
Point pt = new Point();
GetCursorPos(ref pt);
if (aX != pt.X || aY != pt.Y)
{
aX = (pt.X - x);
aY = (pt.Y - y);
this.Location = new Point(pt.X - aX, pt.Y - aY);
}
x = pt.X;
y = pt.Y;
}
modified on Saturday, March 13, 2010 2:38 PM
|
|
|
|
|
|
So his entire problem comes down to one line of code:
Location = System.Windows.Forms.Control.MousePosition;
That's cruel, Luc! He's been at this for days
(and before anyone says anything, yes, you need to use the original offset, and yes, you need to know if you are supposed to move the form, and yes, yada yada yada)You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
So you and I and everyone else have given him the opportunity to learn a lot, not just a single line of code.
|
|
|
|
|
Actually just a few hours if you look at the time stamps
|
|
|
|
|
Not sure he took the opportunity though.
|
|
|
|