Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi.

How I can create a window, based on Text, like in this picture:
http://i.imgur.com/Nm5Q8.png[^]

When I entre with tokens, like + - | ( letters )...
How I can get the size of window, using references of the txt file...
Basicaly, I whant to read the txt and transform the text in Window.
Posted
Comments
Sergey Alexandrovich Kryukov 14-Jun-12 18:50pm    
Well, why?! And what's the problem? Strange thing; even if you already have this mechanism, using it would be inconvenient. What, are you from console word or something. Just assuming monospace fonts... oh... Could do waste your time for something productive? I doubt someone will volunteer time for such a bad idea.
--SA

1 solution

Use Graphics.MeasureString[^] to determine the size of the "Window", then create the form and set its size.

Best regards
Espen Harlinn
 
Share this answer
 
Comments
VJ Reddy 14-Jun-12 19:56pm    
Good answer. 5!
Espen Harlinn 14-Jun-12 20:01pm    
Thanks, it was an odd question :-D
Sergey Alexandrovich Kryukov 14-Jun-12 20:43pm    
Odd question, indeed. No, just a bad idea, related to some preoccupation with strings, maybe consoles, pseudo-graphics, some relict thinking.
Now, do you know that this function does not produce accurate result, reportedly, due to character hinting? And most typically, it returns smaller size than actual size. This is easy to check up.
--SA
Espen Harlinn 15-Jun-12 2:50am    
Thank you, Sergey!
Abhinav S 15-Jun-12 2:37am    
Should help the OP. 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900