Solved! Go to Solution.
Well, I have already find some way to get a point. However, they cannot work appropritately. For example, OnMouseDown event is not exist in Button Add-in classes. Furthermore, OnMouseDown Event in VB Forms can only work in side the form. So I sincerely asking for if there is any other way to obtain a point outside the form within Button Add-ins? If it is appropriate, would you like to show me the sample of codes? I will be really appreciate of it.:cool:
I believe this is what you are trying to do, you will need to reference the appropriate objects in your code as well
public IPoint getpointclicked(IMxApplication mxapp, ISymbol symbol)
{
IAppDisplay appdisplay = mxapp.Display;
IScreenDisplay screendisplay = appdisplay.FocusScreen as IScreenDisplay;
IRubberBand rubberband = new RubberPoint();
IGeometry geo = new Point();
Boolean result = rubberband.TrackExisting(screendisplay, symbol, geo);
if (result)
{
IPoint point = rubberband.TrackNew(screendisplay, symbol) as IPoint;
return point;
}
return null;
}