View Single Post
Old 05-07-2018, 09:39 AM
Norrit Norrit is offline
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,310

My guess is that you've written a form descendant just from code, so without the dfm. If you want a form descendant just add a new form through menu to your app. Then all that is needed for the base of the form is auto-generated.
If it's not a form (what I suspect) you should descent it from something different, TComponent/TObject for example (or none should be ok aswell).

What I meen is replace
TTesty = class(TForm)
TTesty = class(TComponent)

Since I don't see any reason why this should be a form in the beginning. It looks like a placeholder for TMenuItems, which I guess should be added to your form. So I guess you need to add a property of type TMainMenu to your TTesty class. Introduce your own constructor in which you set the private variable of that property

But start simple, just a basic framework with the easiest implementation possible and extend from there. Here you already tried complete implementation including variables and methods.
And just a pointer, instead of variables use properties!
And just personal favor, get rid of the array, T(Object)List is easier and much more readable. Array is something out of the Pascal time period, heavily used at schools but in real life kind of obsolete (true, there are some cases in which it's debatable).
Reply With Quote