Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing a property name

Status
Not open for further replies.

pierrotsc

Programmer
Nov 25, 2007
358
US
I am using D2007. Let's say i have a combobox called combobox. If i add an onlick event, it will have the name of combobox inside the procedure name. Now if i rename it combobox2, the onclick name does not change. Anyway i can have the procedure name reflect the new component property?
I hope i am making sense.

procedure TFrm_Main.ComboboxClick(Sender: TObject);

should become
procedure TFrm_Main.Combobox2Click(Sender: TObject);

Thanks
P
 
I have both D-2010 and D-XE2 and when I change the name of a component, it automatically updates the names of the methods to match the new name.

I can't be 100% on D2007 since I don't have it, but it should behave similarly...
 
This should work, it even works in D5 (that's the oldest version I have access to.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
You should change the name in the Property-editor, not in source, and it should update all occurrences in the source.
 
I guess i got something corrupted in my D2007. When i change the component property in the property editor, the onclick event name does not change.
That's ok...It is not really a big deal.
Thanks for the feedback guys.
P
 
Ok..i did find out that everybody was correct. It does indeed change but not if it is a 3rd party component that has special property.

For example, i was trying a devexpress spinedit that has some oneditchange property. This property will not change if the name of the component is modified but the regular onclick will change.

P
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top