StrataFrame Forum
Back
Login
Login
Home
»
.NET Forums
»
General .NET Discussion
»
How to create a method on base class that known members from subclass?...
How to create a method on base class that known members from subclass?
Post Reply
Like
0
How to create a method on base class that known members from subclass?...
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Fabian R Silva, -
Fabian R Silva, -
posted 17 Years Ago
ANSWER
Topic Details
Share Topic
Group: StrataFrame Users
Posts: 153,
Visits: 1.2K
I Created a BaseForm Class (inherited from Strataframe form) and create a sublass of it (countriesForm)
How I can create a method on BaseForm that known members of the inherited form?
Suppose I create a method named "ChangeTextBoxBackColor" and I want to call it under some circunstanse on my countriesform to change all the textbox dropped on it.
When I debug the method "ChangeTextBoxBackColor" on the base, I not see the textboxes from the countriesForm.
thanks!
Reply
Like
0
Trent Taylor
Trent Taylor
posted 17 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
You have to recursively call the Controls collection to dig down and get them. The Controls collection on a form (or any control object) is not flat and so you have to recursively enumerate the Controls collections to get to all of the objects. More than likely you put your textboxes in a group box, so the Form.Controls will only see the group box and not the text box. The text boxes will be in the GroupBox.Controls collection.
Private Sub SearchControls(Byval controlItems As Control.ControlCollection)
For each item as Control in controlItems
'-- Cycle through the child objects
If item.Count > 0 Then
SearchControls(item.Controls)
End If
Next
End SUb
Reply
Like
0
Fabian R Silva, -
Fabian R Silva, -
posted 17 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Users
Posts: 153,
Visits: 1.2K
I suppose and do it,
the only way is that I pass parameters, not another way that base see sublass / implementation
Thanks for all replies and supress all my doubts.
Reply
Like
0
StrataFrame Team
S
StrataFrame Team
posted 17 Years Ago
ANSWER
Post Details
Share Post
S
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
Yeah, any time the base class needs to see something from the subclass, you need to either pass the data through parameters or have a property/method that is overriden (even defined as MustOverride) that the base class can call to pull from the subclass.
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search