On Jun 21, 2006, at 11:14 AM, Chuck Pelto wrote:

Hi CV,

On Jun 21, 2006, at 10:29 AM, CV wrote:

But, just curious, why does this raise an issue of 'consistency' with Rb? Using Control() to loop through a window's controls to identify the class of an instance, then querying its attributes, is fundamental and well documented.

Because, as I said, in some places, one does one thing to get an answer in another instance, one does something different.

Case in point....

....in MOST instances, one would call upon a property within a control to get the necessary information; e.g., theWindow.theEditField.Text to get the text within an EditField item.

However, in THIS instance, one has to go through the Controls. And even there, there is a difference between getting the text out of an EditField control and getting the Value of a RadioButton. Or it could be the way I was comprehending what people on the ListServ were passing me. There IS more than one way to skin the proverbial cat.

When you know the name of a specific control on a specific window then you could reference it like theWindow.theEditField.Text But this reference has several things built in to it that are not very generic. You KNOW that theEditField is an editfiled, and that edit fields have a text property. That's great, but that's not what you needed or wanted in order to deal with a generic "control"

In this case you have "a window with a bunch of controls" of unknown types They are all "controls". That's all you can tell from the "outside". So look up COntrol in the language reference and you'll see it has very few proprties.

A window "knows" what Controls it has but no more. So it has an array of controls on it. When you get each control you can find out the specific type of that control, hence the need for IsA to figure that out Once you know what the specific type is you can cast it, and then get at any properties that type of control has.

it's the only way to deal with any kind of control in a very generic way
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to