Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DrawString MDI Form
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
DrawString MDI Form
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01533626
Message ID:
01533626
Vues:
80
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.
Regards,
Peter J. Kane



Pete
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform