tags:

views:

72

answers:

3

Does anybody have an example on how to type letters onto a form, like in a graphics program? When I click in a position on the form, I want to be able to start typing and have my text show up on the form.

A: 

Unfortunately I cannot give the exact example that you're looking for. However, I can recommend that you to look at open source projects and try to find an application that does something similar what you need. Then you simply can look at the source code.

You can start with sites like CodePlex and SourceForge.

With a quick search on CodePlex I was able to find two application that might help you:

Image to Text Art

Text Image Generator

Vadim
A: 

If you like to write something on your form you can use GDI+ features.To do so you can override the paint method of your form like this:

protected override OnPaint(PaintEventArgs e)
{

}

PaintEventArgs class has a reference to a graphics object that let you do some graphical stuff on your form. For your task you can use DrawString to write on the surface of your form BTW you should be informed that every time the form surface becomes invalidated it will be painted again and maybe you want to keep what you want to write on your form in a list so that you can write them every time the form is painted again.

Beatles1692
+1  A: 

See this answer to an earlier question:

http://stackoverflow.com/questions/1342689/need-help-creating-control-to-display-data/1342891#1342891

Down at the bottom of the answer are links to a sample application and its source code. This sample shows how to do editing in-place of graphically-draw text. The app basically moves a textbox over the graphics to allow text entry and editing, and then when the user clicks away from the textbox the box is made invisible and the entered text is drawn onto the control surface. You can modify this technique to do what you need.

MusiGenesis