text and caption is gone

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #34842
    cyberhound
    Participant

    after converting my existing .dfm to AC all the text and caption from all buttons, checkboxs etc etc etc are gone

    any fix for this or trick?

    my app has like 20 dif forms dont really feel like changing the controls on all 20 forms

    #46982
    Hamilton
    Participant

    Hey how are you converting the controls? I've updated several apps to AC and haven't had any problems like you describe. I don't know if there is a better way but this is how I'd do it:

    1. Add a TsCheckbox, TsComboBox, TsEdit and any common controls you'll want to use to one form and save it so it builds the include list.

    2. View the form DFM as text and replace TEdit with TsEdit in the DFM (to view the form as text just show the form normally then press Alt-F12).

    3. Press Alt-F12 to switch back to the form then F12 to view the code.

    4. Replace TEdit with TsEdit in the code.

    5. Repeat steps 2 to 4 with each control you're updating (eg Replace TCheckBox with TsCheckBox next, then TsComboBox, etc).

    6. Copy the “uses” from this updated form onto the next form you're going to work on, then repeat steps 2 to 5.

    The important things here are:

    1. Make sure you're including the AC units (ie by putting them in the “uses” section) for the controls you want BEFORE changing the controls over.

    2. Update the DFM BEFORE you update the code. If you change the control in code first then Delphi will raise and error about a type mismatch and won't update control like you might expect (if you're not careful it will remove it).

    3. Update one type of control at a time until you're comfortable with the process and certain that you're not losing data. If you're certain that all of your forms have the same controls then you could update the uses clause in all of them (maybe with a bulk search/replace) and then do a bulk search/replace to update the control types. If you don't know what I mean by this then continue to update the controls one at a time.

    4. Compile after updating each form and save each form after you've finished editing it.

    Good luck.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.