izotope Posted March 2, 2015 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
Administrators Farshad Mohajeri Posted March 2, 2015 Administrators Posted March 2, 2015 Pls send a sample project Quote
NelsonFS Posted March 2, 2015 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
izotope Posted March 2, 2015 Author 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
Administrators Farshad Mohajeri Posted March 2, 2015 Administrators Posted March 2, 2015 Send in PM Please post here. Quote
izotope Posted March 2, 2015 Author Posted March 2, 2015 Please post here. sorry, commercial project Quote
izotope Posted March 6, 2015 Author 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
Administrators Farshad Mohajeri Posted March 6, 2015 Administrators 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
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.