Getting an object reference to a component at runtime


Author
Message
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I'm in over my head again. This looks like something McGuffey would geek out on.



I have a groupbox control - my subclass of SF groupbox.



The goal is to put code in the Leave that will find a tabordercontroller on the form and set focus to the nextvisiblecontrol. (necessary as when on a tabpage is doesn't seem to be able to find it on its own)



The components collection is not exposed and as far as I can tell the TOC is not a in the controls collection.



the me.components.components is empty from within the form.



I am okay with always naming the TabOrdercontroller TOController and assuming only one on a form.



But I want to be able to say "If the parent form of this groupbox uses a tabordercontroller call its method to setfocus to the next visible control"



Thoughts?

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I think my other post might get you there. I'd keep it simple and just add a TabController property to the groupbox. Not only will you get this done faster, it will run faster (no mucking through collections to try and find the controller...its already set). Also, if the TabController ends up not playing nicely, you could always just add a property for the next control, but have its type be System.Windows.Forms.Control, rather than String.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search