Say you create a custom control with the superclass ListBox, call it dbListBox, and there's an instance of dbListBox in ListWindow. And you have multiple instances of ListWindow. And ListWindow has a method called LoadList.

How can I call LoadList from an instance of dbListBox? I had thought I could say "self.LoadList", but it doesn't autocomplete or compile. Doesn't "self" refer to the window the control is in?

Anyway. Can somebody please clear up what I assume is... maybe not the smartest question?


Actually, it's a good question; it's a question of where the LoadList method should live. One way to determine that is by the location of the data it needs. If the data is with the window, then probably LoadList should be a ListWindow method. If so, then you may not need a dbListBox class; instead, use a Listbox in the ListWindow and pass a Listbox parameter to LoadList.


Thanks Phil & Charles, you've given me a bit to think about. You're probably right, now that I think of it, I probably don't need dbListBox.

Do you ever do that thing where you were so sure there was a specific thing you needed to do, but then you couldn't remember why? I can't wait to get back to my code.

Ian
_______________________________________________
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