Recent

Author Topic: [solved] Insert Text at Caret for TComboBox  (Read 3009 times)

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
[solved] Insert Text at Caret for TComboBox
« on: September 30, 2014, 12:24:40 am »
This is me being the absolute bog standard definition of lazy :-)

Don't suppose anyone has any code for inserting text at the caret for a TComboBox?

Sure, I can use SelStart & SelLength, but I never get string manipulation right first time... (excuses)
« Last Edit: September 30, 2014, 12:21:41 pm by Mike.Cornflake »
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Insert Text at Caret for TComboBox
« Reply #1 on: September 30, 2014, 06:30:15 am »
This is me being the absolute bog standard definition of lazy :-)

Don't suppose anyone has any code for inserting text at the caret for a TComboBox?

Sure, I can use SelStart & SelLength, but I never get string manipulation right first time... (excuses)

use copy paste (clipbrd.astext), combobox1.paste or something along those lines.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Insert Text at Caret for TComboBox
« Reply #2 on: September 30, 2014, 12:21:23 pm »
use copy paste (clipbrd.astext), combobox1.paste or something along those lines.

Elegant genius.   And you know what?  Embarrassingly enough, the text I want to insert is *already* on the clipboard, and I never once thought of pasting...

Many thanks :-)
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Insert Text at Caret for TComboBox
« Reply #3 on: September 30, 2014, 02:36:54 pm »
use copy paste (clipbrd.astext), combobox1.paste or something along those lines.

Elegant genius.   And you know what?  Embarrassingly enough, the text I want to insert is *already* on the clipboard, and I never once thought of pasting...

Many thanks :-)

It is not coincidence that Archimedes found his "eureka" while taking a bath :P
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: [solved] Insert Text at Caret for TComboBox
« Reply #4 on: September 30, 2014, 02:45:37 pm »
It is not coincidence that Archimedes found his "eureka" while taking a bath :P

More information than I wanted :D
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

 

TinyPortal © 2005-2018