Re: type directly on graphic object: caret ?




If you dig deep down in the framework, studying .e.g. the
TextBox control, I think you'll find that the caret stuff is still
using the Win32 API.

Search for .Net wrappers for the following Win32 API functions:

CreateCaret
DestroyCaret
GetCaretBlinkTime
GetCaretPos
HideCaret
SetCaretBlinkTime
SetCaretPos
ShowCaret

Unless you want to create and draw your own caret using
fully managed code.

/Joergen Bech



On 6 Nov 2006 01:31:03 -0800, "pamela fluente"
<pamelafluente@xxxxxxxxx> wrote:

howdy guys,

I would need to type characters directly on a graphic object in
response to key press. I want to be able to control globally the char
and words spacing, justification, etc.

I guess I need to measure both chars and string. For that, there should
not be much problem with GDI+, using measurestring or char.

What I have problem to figure out is actually an apparently simple
thing: how to make the cursor (caret) and make it go ahead and back in
response to the key press.

Has anyone ever written some some example code of direct text writing
or is there some known sample on the net from which I could start and
possibly move on? That would be really great.

Thanks

-P

.



Relevant Pages

  • RE: Caret Position in Textbox Control
    ... index of the caret in a TextBox control. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: type directly on graphic object: caret ?
    ... Any actual "coding" idea on how to make and manage the caret? ... TextBox control, I think you'll find that the caret stuff is still ... not be much problem with GDI+, using measurestring or char. ... response to the key press. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Cursor in an uneditable textpane? (or getting chars as they are typed)
    ... I just discovered that getting the caret via ... >I have an application that's lets the user type text into a JTextPane. ... >I transmit this text char by char as it is typed (requirement for the ... >Now it's not very good for the user not to have a cursor while typing, ...
    (comp.lang.java.gui)
  • Re: Caret in TextBox
    ... I have now found how to suppress the caret by 'importing' Win32 as follows: ... /// The HideCaret function removes the caret from the screen. ... how do I get a handle to the TextBox control? ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Cursor in an uneditable textpane? (or getting chars as they are typed)
    ... > I have an application that's lets the user type text into a JTextPane. ... > I transmit this text char by char as it is typed (requirement for the ... Change the caret to alway stay at the end. ...
    (comp.lang.java.gui)