﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » How to create a method on base class that known members from subclass?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 00:17:33 GMT</lastBuildDate><ttl>20</ttl><item><title>How to create a method on base class that known members from subclass?</title><link>http://forum.strataframe.net/FindPost12418.aspx</link><description>I Created a BaseForm Class (inherited from Strataframe form) and create a sublass of it (countriesForm)&lt;br&gt;
&lt;br&gt;
How I can create a method on BaseForm that known members of the inherited form?&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
When I debug the method "ChangeTextBoxBackColor" on the base, I not see the textboxes from the countriesForm.&lt;br&gt;
&lt;br&gt;
thanks!</description><pubDate>Tue, 06 Nov 2007 08:56:19 GMT</pubDate><dc:creator>Fabian R Silva, -</dc:creator></item><item><title>RE: How to create a method on base class that known members from subclass?</title><link>http://forum.strataframe.net/FindPost12472.aspx</link><description>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.</description><pubDate>Tue, 06 Nov 2007 08:56:19 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: How to create a method on base class that known members from subclass?</title><link>http://forum.strataframe.net/FindPost12446.aspx</link><description>I suppose and do it, &lt;br&gt;
the only way is that I pass parameters, not another way that base see sublass / implementation &lt;br&gt;
&lt;br&gt;
Thanks for all replies and supress all my doubts.&lt;br&gt;
&lt;br&gt;</description><pubDate>Mon, 05 Nov 2007 11:03:12 GMT</pubDate><dc:creator>Fabian R Silva, -</dc:creator></item><item><title>RE: How to create a method on base class that known members from subclass?</title><link>http://forum.strataframe.net/FindPost12428.aspx</link><description>You have to recursively call the Controls collection to dig down and get them.&amp;nbsp; 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.&amp;nbsp; 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.&amp;nbsp; The text boxes will be in the GroupBox.Controls collection.&lt;/P&gt;&lt;P&gt;[codesnippet]Private Sub SearchControls(Byval controlItems As Control.ControlCollection)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For each item as Control in controlItems&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Cycle through the child objects&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If item.Count &amp;gt; 0 Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SearchControls(item.Controls)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR&gt;End SUb[/codesnippet]</description><pubDate>Mon, 05 Nov 2007 10:18:52 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>