Invoke a form method from a class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mel

    #1

    Invoke a form method from a class

    I am in my class and I want to invoke a method on my
    form. I made my form method public. But I don't see it
    through intellisensing.

    Any ideas?
  • Morten Wennevik

    #2
    Re: Invoke a form method from a class

    On Tue, 28 Oct 2003 20:51:04 -0800, Mel
    <anonymous@disc ussions.microso ft.com> wrote:
    [color=blue]
    > I am in my class and I want to invoke a method on my
    > form. I made my form method public. But I don't see it
    > through intellisensing.
    >
    > Any ideas?[/color]

    If you make the method public static you can access it through
    namespace.formn ame.method() otherwise you need an instance of the form.
    If you create the class from the form, send 'this' as a parameter and have
    the class store it for later use

    private FormClass parent;

    public Class(FormClass sender)
    {
    parent = sender;
    }

    then use parent.method() when you need to.
    --
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

    Comment

    Working...