Link to home
Start Free TrialLog in
Avatar of Member_2_7965240
Member_2_7965240

asked on

Delphi: how to delete a component which is not visible but it can be seen in object inspector?

Hello,

I got a Delphi project which was not written by me.
A form contains hundreds of visual components, tabs etc.

I need to delete a certain tDbText component. I can find it in Object Inspector and also in Structure, however it is not highlighted on the form (it is visible).

How can I delete it? ( it is in Delphi 2010).

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
on form are tabs - I assume that is on one of them.
Maybe make it hidden in forms OnShow event is the right solution ....
Well, then simply remove it in the text view of the form.
lots of controls can hide components

TPageControls are most used
TNotebooks (very old) have this too
Tpanels can do just the same

Moving it outside the visible form area with just changing top or left is just as easy

in the .dfm text find the component, then scroll up to find the parent at a lesser indentation
you might be able to trace it to a visible component that way

as indicated above, text dfm, locate, delete

then hit compile, delphi will ask to remove the text identifier
and then probably complain about a missing component on next compile :)
You can for sure do all suggested by other experts and it of course will work.
Anyway you said that you can see it in the Structure Tab. That's exactly why there's such a feature in your IDE: to see a friendly browsable structure of your whole form. Simply locate the control in your Structure treeview, select it and press DEL on your keyboard.