Re: Getting a Ttab*** to show on start-up




"Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx> schreef in bericht
news:43d89110$0$11073$e4fe514c@xxxxxxxxxxxxxxxxx
> Firing a timer happens through a Windows message, so it will never
> happen before the project file reaches the Application.Run line.
> So you can be really sure. You could also post a message to yourself,
> that would be slightly cleaner.

Ah, very useful.

> All the same, I don't think I'd do this. For things that stay within
> the form, overriding Loaded is the proper way.

Learned that from you. Do that standard now.

>Things that may look
> outside their own form need to wait until all forms have initialised;
> I'd probably add a line to the project file.

But where ? I hesitate to start things outside the message loop.

>Or rearrange so forms don't depend on other forms.

One form is to allow user to translate the application to another language
(being thoroughly fed up with the Translation Manager). It presents all text
items (captions, hints, lists, messages) of all forms. Its initialisation
must wait for completion of all other forms. But otherwise I agree.

>> [...] What happens is that the first tab gets the focus mark but the
>> image of the pagecontrol is of the tab*** that was selected in the
>> designer. When I click the first tab nothing changes (I guess because
>> it already has the focus). When I click the 'designer' tab the image
>> doesn't change (since it is already what it should be) and the
>> corresponding tab now gets the focus mark. Only after clicking the
>> first tab after clicking the other or a third tab will display the
>> proper image of the first tab.
>
> Very strange. Have you tried Invalidating some things, or HandleNeeded?

Tried them. No success. The problem occurs only with one of the tabsheets,
whatever pageIndex I give it. No problem with other tabsheets.
I have solved it though: with the call to tabindex:=0 in loaded rather than
in the timer event handler the behaviour is as required.
Tom



.


Quantcast