Click here to Skip to main content
15,888,521 members
Home / Discussions / C#
   

C#

 
QuestionHowto write text into a picturebox on runtime Pin
NewJavaBean13-Jul-09 11:34
NewJavaBean13-Jul-09 11:34 
AnswerRe: Howto write text into a picturebox on runtime Pin
Luc Pattyn13-Jul-09 11:54
sitebuilderLuc Pattyn13-Jul-09 11:54 
GeneralRe: Howto write text into a picturebox on runtime Pin
NewJavaBean13-Jul-09 12:20
NewJavaBean13-Jul-09 12:20 
GeneralRe: Howto write text into a picturebox on runtime Pin
Luc Pattyn13-Jul-09 12:34
sitebuilderLuc Pattyn13-Jul-09 12:34 
GeneralRe: Howto write text into a picturebox on runtime Pin
NewJavaBean13-Jul-09 12:42
NewJavaBean13-Jul-09 12:42 
GeneralRe: Howto write text into a picturebox on runtime Pin
Luc Pattyn13-Jul-09 12:49
sitebuilderLuc Pattyn13-Jul-09 12:49 
GeneralRe: Howto write text into a picturebox on runtime Pin
NewJavaBean13-Jul-09 13:03
NewJavaBean13-Jul-09 13:03 
GeneralRe: Howto write text into a picturebox on runtime Pin
Luc Pattyn13-Jul-09 13:24
sitebuilderLuc Pattyn13-Jul-09 13:24 
That is entirely up to you. Here are some possibilities; they all share a "trigger", i.e. something telling your app that text is going to be added (could be a button, menu item, whatever):

1. have the user click on the PB, then hit the trigger; now create a dynamic textbox and add it to PictureBox.Controls giving it the clicked location. Enter the text, upon ENTER read the text, remove the TB from the Controls, add the text to the drawing.
2. without a TB: have the user click on the PB, then hit the trigger; now, let him type text and add it immediately to the drawing until he terminates with ENTER. Here you don't have a cursor, no copy/paste, and you need to support backspace/delete for editing. Is probably more visually pleasing though, as you see the results immediately.
3. with a static TB outside the PB.
4. with a text entry dialog.

1. uses the trigger event, and the TB.KeyDown event to check for ENTER.
2. uses the trigger event, and the PB.KeyPress event (for text) and PB.KeyDown event (for ENTER).

BTW: Once more, I would use a Panel, not a PB.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Howto write text into a picturebox on runtime Pin
NewJavaBean13-Jul-09 14:53
NewJavaBean13-Jul-09 14:53 
AnswerRe: Howto write text into a picturebox on runtime Pin
Christian Graus13-Jul-09 14:25
protectorChristian Graus13-Jul-09 14:25 
QuestionPathGradientBrush and irregular shapes Pin
JimLaVine13-Jul-09 10:54
JimLaVine13-Jul-09 10:54 
AnswerRe: PathGradientBrush and irregular shapes Pin
Christian Graus13-Jul-09 10:59
protectorChristian Graus13-Jul-09 10:59 
AnswerRe: PathGradientBrush and irregular shapes Pin
Luc Pattyn13-Jul-09 11:25
sitebuilderLuc Pattyn13-Jul-09 11:25 
AnswerRe: PathGradientBrush and irregular shapes Pin
Henry Minute13-Jul-09 12:02
Henry Minute13-Jul-09 12:02 
Questiongetting specific string error? [modified] Pin
maifs13-Jul-09 10:46
maifs13-Jul-09 10:46 
AnswerRe: getting specific string error? Pin
Luc Pattyn13-Jul-09 10:57
sitebuilderLuc Pattyn13-Jul-09 10:57 
AnswerRe: getting specific string error? Pin
Christian Graus13-Jul-09 10:57
protectorChristian Graus13-Jul-09 10:57 
QuestionGraphics.MeasureString accuracy Pin
tasoss13-Jul-09 10:16
tasoss13-Jul-09 10:16 
AnswerRe: Graphics.MeasureString accuracy Pin
Christian Graus13-Jul-09 10:39
protectorChristian Graus13-Jul-09 10:39 
GeneralRe: Graphics.MeasureString accuracy Pin
tasoss13-Jul-09 10:47
tasoss13-Jul-09 10:47 
GeneralRe: Graphics.MeasureString accuracy Pin
Christian Graus13-Jul-09 10:58
protectorChristian Graus13-Jul-09 10:58 
GeneralRe: Graphics.MeasureString accuracy Pin
tasoss13-Jul-09 11:58
tasoss13-Jul-09 11:58 
AnswerRe: Graphics.MeasureString accuracy Pin
Luc Pattyn13-Jul-09 10:46
sitebuilderLuc Pattyn13-Jul-09 10:46 
QuestionAccessing a mapped drive in windows service Pin
mark_me13-Jul-09 9:48
mark_me13-Jul-09 9:48 
AnswerRe: Accessing a mapped drive in windows service [modified] Pin
Paladin200013-Jul-09 10:22
Paladin200013-Jul-09 10:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.