Results 1 to 3 of 3

Thread: [RESOLVED] Initialize Class Inside Shared Method

  1. #1

    Thread Starter
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Resolved [RESOLVED] Initialize Class Inside Shared Method

    It's that even possible?

    I created a simple DDL that has one form, i only need one method from that form, that's the My_Show method, it takes several parameters, and in the end it simple calls the ShowDialog.

    The form is working like a normal form, i need to create an instance of it before calling the My_Show method. It works but it's not very useful... So I was thinking, how can I the form in the same way of the Message Box class.

    How can I do that? Shared/static My_Show method? But to do this, how do I instantiate the class? Do i really need to instantiate the class, or just set all properties, methods to shared?

    Never done anything like this

    Thanks

    Rate People That Helped You
    Mark Thread Resolved When Resolved

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    Re: Initialize Class Inside Shared Method

    Since it's a DLL, why not move the Shared method into a module? You can then create an instance (if there isn't one already) and show it from the method. Technically, you could do the same thing in a shared method of the class, as what you would end up with would be like a Singleton form.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Re: Initialize Class Inside Shared Method

    Thanks
    Didn't remember of the first solution...
    Just went to the singleton Form.

    Thanks

    Rate People That Helped You
    Mark Thread Resolved When Resolved

Posting Permissions

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



Click Here to Expand Forum to Full Width