diegojmap Posted March 8, 2017 Share Posted March 8, 2017 Can I access the frame components through the maimmodule?I tried several forms and the "access violation".For example:TUniFrame1 (TUniFrameClass (FindClass ('TUniFrame1))) GroupBox3.Visible: = False; Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 8, 2017 Administrators Share Posted March 8, 2017 Hi, Frame is just like any other component on a form. Just like a Button. You can not access a Button without knowing its owner first. After all, trying to access a Frame from MainModule is a very bad OOP practice. Quote Link to comment Share on other sites More sharing options...
diegojmap Posted March 14, 2017 Author Share Posted March 14, 2017 But for example I have a frame called FrameDigitacao.I need another object to give this command.How would I do it?FrameDigitacao.UniDBEdit5.SetFocus; Undeclared identifier: 'FrameDigitacao' Quote Link to comment Share on other sites More sharing options...
RobYost Posted March 15, 2017 Share Posted March 15, 2017 in your main form: public FrameDigialcao: TFrameDigalcao; end (or private if you don't need it elsewhere) When you need to use the frame: if (FrameDigialcao = nil) then FrameDigialcao := TFrameDigialcao.Create(self); FrameDigitacao.UniDBEdit5.SetFocus; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.