For Programmers: Free Programming Magazines  


Home > Archive > Delphi > March 2004 > Re: TabSheets









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: TabSheets
Henry Bartlett

2004-03-27, 12:20 am

Richard <rwskinner@worldnet.att.net> wrote

> I have a Tab that is for viewing the error log file within a memo.
> I do want to read the error log until somebody actually clicks on
> the tab, when they exit I want to clear them memo.
>
> On tabsheet Enter event, the memo doesn't do anything until you
> actually click on the form, not what I had in mind. Then when a
> different tabsheet is selected, I want to do a memo.clear.


Hi Richard

I am not entirely clear as to what you are trying to do.

Since you mention Tabsheets, I assume that you are using a
PageControl.with Tabsheets. Right?

Check out tPageControl's OnChange and OnChanging event-handlers.

The OnChanging event fires _before_ you switch to the new tabsheet so
that's the place to put your Memo.Clear.

The OnChange event fires _after_ you have switched to the new tabsheet
so that's where you put your read-error-log code.

> OnEnter and OnExit do not perform how I expected, is the terminology
> different from what I woulkd think?


OnEnter fires when your component gets the focus by a mouseclick on it
or by tabbing into it. So if you never give your tabsheet the focus it
never fires.

Similarly, OnExit fires when your component loses the focus by a
mouseclick on something else or by tabbing out of it. So if you never
gave your tabsheet the focus the event will never fire.

And please don't multipost.

--
Henry Bartlett
HABit utilities ( http://www.hotkey.net.au/~hambar/habit/ )







Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com