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! 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 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; 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 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! 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. 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 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 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now