Re: type directly on graphic object: caret ?



Hi Joergen, thanks!

Hmmm, Now that you mention it, think that probably for easy and
complete control it's better to write the code.

For instance, just from the list I cannot see a function to set the
height of the caret,
which clearly is something I need.

Any actual "coding" idea on how to make and manage the caret ? For
instance how about blinking, should I use a timer? So just make a
blinking thin rectangle ?

-P

Joergen Bech ha scritto:

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: Difficulties in deriving a truly universal GUI Scripting Language
    ... What the caret ... It could also control the mouse and the keyboard. ... From this information, the script could ... You would merely have to re-examine the screen display after every input ...
    (microsoft.public.vc.mfc)
  • Re: Caret problems with IE7
    ... I have a similar problem with the caret. ... control with a custom edit control inside it. ... dialog and setting the focus back to my edit control. ... give IE7 the ownship and doesn't allow me to show it. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Caret problems with IE7
    ... I have a similar problem with the caret. ... control with a custom edit control inside it. ... dialog and setting the focus back to my edit control. ... give IE7 the ownship and doesn't allow me to show it. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Difficulties in deriving a truly universal GUI Scripting Language
    ... But note that the caret is a graphical artifact with no semantic content. ... means is whatever the control that is displaying it chooses to have it mean. ... scripting language "I want this caret before the 'i' in 'is'" and let it do whatever it ... of spontaneously scroll underneath you. ...
    (microsoft.public.vc.mfc)
  • Re: Difficulties in deriving a truly universal GUI Scripting Language
    ... interpretation, but yes, it *is* possible, although unlikely, the caret ... Even the rich edit control, in one of the most glaring API oversights I've ... In that case the script author would have to have the script do the same ... of spontaneously scroll underneath you. ...
    (microsoft.public.vc.mfc)