New component in Delphi

Started by
0 comments, last by Indeterminatus 21 years, 7 months ago
Hello, guys! First of all, thanx to your replies to my post memory management, you really helped me a lot! But naturally, a programmer''s needs can never be satisfied , and therefor i have another question to you: How do i create a new component derived from TMainMenu which should hold some additional properties in a TMenuItem -entry? I know how to add properties to ... let''s say a button ..., but how does that work with this stuff ? Yours, Indeterminatus --si tacuisses, philosophus mansisses--
Indeterminatus--si tacuisses, philosophus mansisses--
Advertisement
Basically what you have to do is create a descendant of TMainMenu (Let''s call it TMyMenu) and a descendant of TMenuItem (TMyMenuItem).
Then alter TMyMenu so that it uses TMyMenuItem instead of TMenuItem.

I dunno which version of Delphi you have, but if yours comes with the source code to the VCL, take a look at TMainMenu and TMenuItem...especially TMenuItem.
TMenuItem actually can hold sub-items (and usually does)... so if you want to make a TMyMenuItem, you''ll have to change quite a bit.

This topic is closed to new replies.

Advertisement