In Berlin Anniversary, I'm working on a new FMX project for OS X. I have a form with a TTabControl that contains two TTabItems. However, Self.ActiveControl always is the value of one particular component (a TStringGrid) on one of the tabs, even when actually I'm typing into a TEdit box on the other TabItem.

In Berlin Anniversary, I'm working on a new FMX project for OS X. I have a form with a TTabControl that contains two TTabItems. However, Self.ActiveControl always is the value of one particular component (a TStringGrid) on one of the tabs, even when actually I'm typing into a TEdit box on the other TabItem.

To simplify the problem, I created a tiny program. However, in this program I have a different problem: regardless of which tab and which component I'm on, Self.ActiveControl is nil! Shouldn't it be the current control that is active?

I'm bewildered and not sure what's going on. Sample tiny test program is here: http://fieldtestedsystems.com/download/testproject.zip (it uses CodeSite for logging.)

As often the case, I'm sure (and hopeful) this is just some careless mistake or misunderstanding on my part. Thanks for any help on this.
http://fieldtestedsystems.com/download/testproject.zip

Comments

  1. ActiveControl seems to be unaffected at all by user activating any controls by keyboard or mouse. The value of ActiveControl, whatever it is, just doesn't change. (So far, the only way I've found to change it is in code.)

    ReplyDelete
  2. Ondrej Kelle Thanks for the confirmation.

    I just determined that IsFocused property (or method?) works on the controls I'm interested in (TEdits). So I can use that to determine which of a handful of controls on a tab is active rather than the form's ActiveControl property.

    Seems that should report to Quality Central that ActiveControl not working.

    ReplyDelete
  3. Tom Field Yes, please report it. As far as I know, it was working fine up to Update 1 (or maybe Update 0). At Frontier Software, we made liberal use of ActiveControl.

    ReplyDelete

Post a Comment