izotope Posted March 2, 2015 Share Posted March 2, 2015 Well and how can I access the object in the frame of the other forms of application? Let's say I have a frame called frOneFrame (TfrOneFrame) unit in which it is located uOneFrame Button1 object I tried (frOneFrame as TfrOneFrame) .Button1.Enabled = true; But I did not work Thanks! Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 2, 2015 Administrators Share Posted March 2, 2015 Pls send a sample project Quote Link to comment Share on other sites More sharing options...
NelsonFS Posted March 2, 2015 Share Posted March 2, 2015 You can declare a form in public part, after that, get it from typecast: (MyForm.frOneFrame as TfrOneFrame) .Button1.Enabled = true; Quote Link to comment Share on other sites More sharing options...
izotope Posted March 2, 2015 Author Share Posted March 2, 2015 Pls send a sample project Send in PM Quote Link to comment Share on other sites More sharing options...
izotope Posted March 2, 2015 Author Share Posted March 2, 2015 You can declare a form in public part, after that, get it from typecast: (MyForm.frOneFrame as TfrOneFrame) .Button1.Enabled = true; Little do not understand. That is, I need a form from which I need access to the frame, declare the same frame? Such form is called MyForm Which section do it and how? Thank U! Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 2, 2015 Administrators Share Posted March 2, 2015 Send in PM Please post here. Quote Link to comment Share on other sites More sharing options...
izotope Posted March 2, 2015 Author Share Posted March 2, 2015 Please post here. sorry, commercial project Quote Link to comment Share on other sites More sharing options...
izotope Posted March 6, 2015 Author Share Posted March 6, 2015 You can declare a form in public part, after that, get it from typecast: (MyForm.frOneFrame as TfrOneFrame) .Button1.Enabled = true; (MainForm.FCurrentFrame as TfrCompanyGoodsFrame).UniTimer.Enabled:=true; Invalid Typecast Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 6, 2015 Administrators Share Posted March 6, 2015 (MainForm.FCurrentFrame as TfrCompanyGoodsFrame).UniTimer.Enabled:=true; Invalid Typecast Why not simply enable the timer on Frame itself. Global objects referring to each other controls is a very bad OOP practice. 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.