I have yet another problem..
Consider looking at THIS first..
on my early problems, I needed to drag a button, and a form in relation to how I drag/move the pictureBox.. All controls are inside .NET
Now I am working on this great Control, GMaps in which adapts the google's API in .NET framework.
My goal is to create something like the infoWindow on google's API. so I resorted on customizing it by creating a new form (acting as the infoWindow) on the first link above.
If you've seen Gmaps.net, it really is a map. Draggable, pan to zoom, can add markers/polygons.. one thing that it lacks is its documentation + the infoWindow tool that I want with the marker..
it only has its "tooltip" that can only have string in it.
e.g marker.ToolTipText="Blah Blah"
on codeplex' discussions, it is said that you must create your own tooltip for it not to only display a string. but I can't find a good example except THIS in which inherits a contextMenu which I cannot particularly use because whenever I click again, it disappears.
back to my question, if you've checked the first link above, you'll know what I want to achieve, the only problem now is, I can't use this code as it is :
Point p = Button1.PointToScreen(Point.Empty);
p.Offset(0, (-1 * Form2.Height) - 15);
Form2.Location = p;
this code makes Form2
follow Button1
wherever it goes.. Unfortunately, on my gMap control, there is no button. there is only the marker inside.
Remember : this map is a control
so, how can I use the marker as a parent of the form, so if I try to drag the map, it follows.. something like this :
Point p = marker.PointToScreen(Point.Empty);
p.Offset(0, (-1 * Form2.Height) - 15);
Form2.Location = p;
UPDATE I used this code, no errors, does not work..
void mainMap_MouseDown(object sender, MouseEventArgs e)
{
Point p = (marker.LocalPosition = PointToScreen(Point.Empty));
//Point p = button1.PointToScreen(Point.Empty); --> this gives the error that it cannot be converted
p.Offset(0, (-1 * f2.Height) - 15);
f2.Location = p;
}