Hi Pete,
I suppose what I'm asking is, how do I know if the mouse is over my *drawn text* ?I haven't done anything with Graphics or Drawing, so I may be totally out to lunch on this ... but it seems to me that all you have to do is check the mouse position in the mouse event handler and compare that to the location of the drawn text, given that you know x, y and s.Width and s.Height. (You could save those variable as fields or properties on your Form).
~~Bonnie
>Hi All, I draw a user defined message on a MDI Form using DrawString() in the Paint event, what I would like to do, is , if the user clicks or double clicks on the text , popup some method which enables them to specify the text, I suppose what I'm asking is, how do I know if the mouse is over my *drawn text* ? This is the code I use called from Paint() .
>
>>void DrawMyText(Graphics g, string MyText)
>{
> SizeF s = g.MeasureString(MyText, MyFont);
> float x = this.Width / 2 - s.Width / 2;
> float y = this.Height / 2 - s.Height / 2;
> g.DrawString(MyText,MyFont,Brushes.Gold,x,y,StringFormat.GenericTypoGraphic);
>}
>
>
>This just centres the text on the form.