BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TMemo & Disabling to became focused...

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Vladimir Stefanovic
Guest





PostPosted: Wed Jan 28, 2004 4:01 pm    Post subject: TMemo & Disabling to became focused... Reply with 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.

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





PostPosted: Wed Jan 28, 2004 8:09 pm    Post subject: Re: TMemo & Disabling to became focused... Reply with quote




"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





PostPosted: Wed Jan 28, 2004 9:21 pm    Post subject: Re: TMemo & Disabling to became focused... Reply with quote



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





PostPosted: Thu Jan 29, 2004 7:32 am    Post subject: Re: TMemo & Disabling to became focused... Reply with quote

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





PostPosted: Thu Jan 29, 2004 11:57 am    Post subject: Re: TMemo & Disabling to became focused... Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.