VuurSnikkel
Programmer
Hello there,
I'm currently having trouble "switching frames" at runtime. I've got four different TFrames (as seperate files; I've added them to my project using "New Frame" and I've got a "main" form that has a TFrame on it which I want to use as the container for one of the four seperate frames.
First of all, when I create the container frame on the main form within Delphi, it immediately asks me what frame I want to use as the content. At that point, I'm not interested in the content (I want to decide at runtime), but because of the fact that Delphi forces me to choose a frame, I simply chose the first one of the four seperate frames as the content for my container frame.
I've also got a TComboBox on my main form and with it I want to be able to select one of the four seperate frames as the content for my container frame. And that's where the problems start...
Even when I include the units in which the four seperate frames are stored within the Uses list of my main form, I'm not able to use them in my code like this (just an example of how I tried to switch frames at runtime):
Uses
ContentFrameAUnit;
MainForm.ContainerFrame:=ContentFrameA;
Delphi simply refuses to accept "ContentFrameA" (yes, the names are all right of course).
What is the correct way to do this "farme switching at runtime"? And if - for example - I want to set the DoubleBuffering option of my ContainerFrame to True and I do so at MainForm.FormCreate, will this remain at True even when I load another frame as the content or does the container frame take over the property values of the relevant content frame? Thanks in advance.
GRTZ,
(Sn)Ik.
I'm currently having trouble "switching frames" at runtime. I've got four different TFrames (as seperate files; I've added them to my project using "New Frame" and I've got a "main" form that has a TFrame on it which I want to use as the container for one of the four seperate frames.
First of all, when I create the container frame on the main form within Delphi, it immediately asks me what frame I want to use as the content. At that point, I'm not interested in the content (I want to decide at runtime), but because of the fact that Delphi forces me to choose a frame, I simply chose the first one of the four seperate frames as the content for my container frame.
I've also got a TComboBox on my main form and with it I want to be able to select one of the four seperate frames as the content for my container frame. And that's where the problems start...
Even when I include the units in which the four seperate frames are stored within the Uses list of my main form, I'm not able to use them in my code like this (just an example of how I tried to switch frames at runtime):
Uses
ContentFrameAUnit;
MainForm.ContainerFrame:=ContentFrameA;
Delphi simply refuses to accept "ContentFrameA" (yes, the names are all right of course).
What is the correct way to do this "farme switching at runtime"? And if - for example - I want to set the DoubleBuffering option of my ContainerFrame to True and I do so at MainForm.FormCreate, will this remain at True even when I load another frame as the content or does the container frame take over the property values of the relevant content frame? Thanks in advance.
GRTZ,
(Sn)Ik.