| View previous topic :: View next topic |
| Author |
Message |
Oliver Young Guest
|
Posted: Wed Jan 21, 2004 1:39 pm Post subject: TMemo and SelectAll (CTRL+A) |
|
|
Why CTRL+A doesn't select all text in TMemo? I'm using BCB6 on WinXP
Pro.
|
|
| Back to top |
|
 |
Oliver Young Guest
|
Posted: Wed Jan 21, 2004 1:56 pm Post subject: Re: TMemo and SelectAll (CTRL+A) |
|
|
Btw, my memo is read only.
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Wed Jan 21, 2004 4:55 pm Post subject: Re: TMemo and SelectAll (CTRL+A) |
|
|
Oliver Young wrote:
| Quote: | Btw, my memo is read only.
|
And if it is not read only ?
Hans.
|
|
| Back to top |
|
 |
Oliver Young Guest
|
Posted: Thu Jan 22, 2004 1:21 pm Post subject: Re: TMemo and SelectAll (CTRL+A) |
|
|
| Quote: | And if it is not read only ?
Still the same. Why? |
|
|
| Back to top |
|
 |
Fishface Guest
|
Posted: Thu Jan 22, 2004 7:58 pm Post subject: Re: TMemo and SelectAll (CTRL+A) |
|
|
Oliver Young wrote:
| Quote: | Why CTRL+A doesn't select all text in TMemo?
I'm using BCB6 on WinXP Pro.
|
No answers here, just a possible solution.
This works in very limited testing on BCB5:
Create a handler for the OnShortCut event of your form.
void __fastcall TForm1::FormShortCut(TWMKey &Msg, bool &Handled)
{
if((Msg.CharCode == 'A') && (ActiveControl == Memo1) &&
(0x4000 & GetKeyState(VK_CONTROL)))
{
Memo1->SelectAll();
Handled = true;
}
}
|
|
| Back to top |
|
 |
Fishface Guest
|
Posted: Fri Jan 23, 2004 5:32 am Post subject: Re: TMemo and SelectAll (CTRL+A) |
|
|
Fishface wrote:
| Quote: | This works in very limited testing on BCB5:
|
Or this, instead, for multiple TMemo and TEdit components.
TRichEdit doesn't seem to need it, though...
void __fastcall TForm1::FormShortCut(TWMKey &Msg, bool &Handled)
{
if((Msg.CharCode == 'A') && (0x4000 & GetKeyState(VK_CONTROL)))
{
TControl *ac = ActiveControl;
if (ac->InheritsFrom(__classid(TCustomEdit)))
{
static_cast<TCustomEdit *> (ac)->SelectAll();
Handled = true;
}
}
}
|
|
| Back to top |
|
 |
|