CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: How Do I

  1. #1
    Join Date
    Mar 2003
    Posts
    176

    How Do I

    Hi People,
    In my project , I've got a Module Class that makes the background task of a form ...
    My Problem is ...
    Hey I'm arriving to the point that my form as to call a method of this class (select on comboboxes) to update her behaviour.
    The class needs to refer to properties of control of the form
    How do I implement the overall ?

    1- Form sends events to the class -that instantiated it-
    2- Form Implements class and How do my class acts on the form
    3- Class Implements form and How do my form acts on the class
    ....
    or more?

  2. #2
    Join Date
    Mar 2002
    Posts
    79
    This can be achieved in two ways.

    As i get to your question. lemme know if the way i understand it is wrong:
    1. The form calls a method on a object which in between might have to access the control(onthe form) properties?

    If an object is processing a call from a form and in between this has to refer back to the form for some of its control's properties, either you can use the callback method and depend on the sink object to answer your objects queries or pass all the props as parameters to the call.

    I don't know if i have answered your question. But please let me know.

    have fun
    sam

  3. #3
    Join Date
    Mar 2003
    Posts
    176
    Hi and thanks for those idea ...
    U understood well ...
    Well to my point of vue, the code would be more ligther if I use Events ... But from a speed point of vue it's certainly better to use function ..
    That's why I was looking more for inheritance wich have the double skills (I think..)
    If times gets critical I would implements callback ...

    Let me know if I was wrong on the evaluation of speed between these different method ...

    Pierre

  4. #4
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487
    1- Form sends events to the class -that instantiated it-
    2- Form Implements class and How do my class acts on the form
    3- Class Implements form and How do my form acts on the class
    There are ways to send events to the class, one way is to add a method that will raise the specific event of the class. Another one is to build an interface, implementing the form into the class or vise versa, the way they act by callback or event.. Furthermore,
    check the Implement statement and vb help for "Interfaces and Polymorphism")..
    Busy

  5. #5
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Lightbulb

    There is no inheritance in VB.. It can be achived thru Interface...
    Busy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)