Results 1 to 5 of 5

Thread: Cast

  1. #1

    Thread Starter
    Ya ya Baby!!!Me is Back
    Join Date
    Jul 2002
    Posts
    362

    Cast

    Hi,

    I need to cast a FORM that implements something to his original form to get its procedures. How can I do that?

  2. #2
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: Cast

    Quote Originally Posted by Daok
    Hi,

    I need to cast a FORM that implements something to his original form to get its procedures. How can I do that?
    I have no clue what you are trying to do specifically, but in general, you can do a kind of (void *) cast in VB by "Set"-ing an Object = to an object of type "Object":

    VB Code:
    1. Dim frmThing as Form
    2. Dim objThing as Object
    3. '
    4. Set objThing = frmThing
    5. '
    6. ' From here, objThing is treated as a generic Object, and will be Late-Bound.

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Cast

    Quote Originally Posted by Daok
    Hi,

    I need to cast a FORM that implements something to his original form to get its procedures. How can I do that?
    Dim frm As Form

    Set frm = New Form1
    frm.Show

    You may want to set Caption, Tag for each new instance so you can differenciate between the forms code wise.

  4. #4

    Thread Starter
    Ya ya Baby!!!Me is Back
    Join Date
    Jul 2002
    Posts
    362

    Re: Cast

    Thank you guys,

    Rhino solution work like a charm! (Thx Dave, you had the theory of what I want).

    Bye!

    Daok

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Cast

    No problem, you're welcome.

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