title: changing active control using fontdialog and RichEdit
body: <p>I migrated from Delphi v7 to Delphi XE2. I am trying to use a fontdialog with two dbrichedit and a dbedit control. The code I used to accomplish the task works fine in Delphi v7, but it does not work with XE2. I think it must be some simple thing I have overlooked. I have worked on resolving the issue for over a week, but I am too close to the problem to see it I think.</p>
  
  <p>I used a button to execute fontdialog and an apply event to manipulate the text.</p>
  
  <p>Code:  </p>
  
  <pre><code>if ActiveControl is TDBEdit then 
    with ActiveControl as
    TdbEdit do
      Font.Assign(TFontDialog(Sender).Font)
  else if ActiveControl is TDBRichEdit then 
    with ActiveControl as TDBRichEdit do
      SelAttributes.Assign(TFontDialog(Sender).Font)
  </code></pre>
  
  <p>Nothing happens.</p>
  
  <p>Is there a property for form1 that I have overlooked?</p>