 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Vladimir Stefanovic Guest
|
Posted: Wed Jan 28, 2004 4:01 pm Post subject: TMemo & Disabling to became focused... |
|
|
How can I achieve that TMemo never gets focus and
acts just like a sequence of TLabels. That means:
No focus, no popup, no selection, ... just text.
I found property 'Handled = true' in OnPopup event
that disables standard popup menu...
I also have found a solution to use OnEnter event and
save last focused control and return focus to it when
OnEnter triggers, but I suppose that there is some
easier solution...
Vladimir.
P.S. Sorry if this message appeared twice in your newsreader.
My PC System time was not up to date (battery problems),
so I had to post it again.
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Wed Jan 28, 2004 8:09 pm Post subject: Re: TMemo & Disabling to became focused... |
|
|
"Vladimir Stefanovic" <antivari (AT) ptt (DOT) yu> wrote:
| Quote: | How can I achieve that TMemo never gets focus and
acts just like a sequence of TLabels. That means:
No focus, no popup, no selection, ... just text.
|
Put it on a boarderless panel and set the panel->Enabled to false;
~ JD
|
|
| Back to top |
|
 |
Vladimir Stefanovic Guest
|
Posted: Wed Jan 28, 2004 9:21 pm Post subject: Re: TMemo & Disabling to became focused... |
|
|
| Quote: | Put it on a boarderless panel and set the panel->Enabled to false;
~ JD
|
Hm... That sounds fine. I'll try tomorrow.
|
|
| Back to top |
|
 |
Fishface Guest
|
Posted: Thu Jan 29, 2004 7:32 am Post subject: Re: TMemo & Disabling to became focused... |
|
|
Vladimir Stefanovic wrote:
| Quote: | How can I achieve that TMemo never gets focus and
acts just like a sequence of TLabels. That means:
No focus, no popup, no selection, ... just text.
|
By putting this in the form's constructor, the window will
be disabled without graying the text as with EnableWindow:
HWND wnd = Memo1->Handle;
long style = GetWindowLong(wnd, GWL_STYLE);
style = style | WS_DISABLED;
SetWindowLong(wnd, GWL_STYLE, style);
|
|
| Back to top |
|
 |
Vladimir Stefanovic Guest
|
Posted: Thu Jan 29, 2004 11:57 am Post subject: Re: TMemo & Disabling to became focused... |
|
|
| Quote: | By putting this in the form's constructor, the window will
be disabled without graying the text as with EnableWindow:
|
Well, when Disabling Panel, the Memo text is NOT grayed.
I also noticed (maybe this is normal behavior) when you try
to disable TGroupBox, TRadioGroup, and TPanel, the
Caption still stays NON-greyed
| Quote: | HWND wnd = Memo1->Handle;
long style = GetWindowLong(wnd, GWL_STYLE);
style = style | WS_DISABLED;
SetWindowLong(wnd, GWL_STYLE, style);
|
This is useful piece of code, and I'll note it...
Thanks,
Vladimir.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|