2

I've occasionally come across examples of edit controls that have a special indicator to assist the user, like so:

edit control special indicator

and I'd like to be able to implement similar in my own code.

The screen-scrap is actually from the property editor for the TIBQuery Sql property and isn't quite what I'm after (otherwise I'd just look in the IBX code) because it disappears as soon as the user types anything. There are others where the indicator moves so as to keep its place as the user types something, but doesn't replace the caret, otherwise I'd just do that.

So my question is, how to implement a special indicator of the type I've tried to describe, that can be positioned and turned on/off in code? The simplest thing I could think of would be to somehow temporarily add a special glyph to the edit control's character set, but I have no idea how to do that, nor how to colour it differently than the control's text content.

MartynA
  • 30,454
  • 4
  • 32
  • 73
  • Use the caret API: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646968.aspx – David Heffernan Aug 10 '14 at 10:42
  • 2
    Did you take a look at: `source\Win32\Property Editors\SqlEdit.pas`? specially at `procedure TSQLEditForm.DrawCaretPosIndicator;`. You can utilize the editor code to your special needs. (That is, if you need another indicator besides the caret) – kobik Aug 10 '14 at 10:48
  • @David Heffernan: I confess I hadn't looked at that(but will, thanks for the reference), because I'd assumed that caret functions would involve replacing the existing caret, whereas some indicators I recollect seeing are in addition to, and position independently of, the "normal" caret. I am obliged to Kobik, too. – MartynA Aug 10 '14 at 11:02
  • Related question with code sample: http://stackoverflow.com/questions/12422720/is-it-possible-to-made-a-tcombo-edit-caret-wider-or-to-bold-it – Warren P Aug 11 '14 at 18:46

0 Answers0