Results 1 to 6 of 6

Thread: Accessing FORM components from a module

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    26

    Question Accessing FORM components from a module

    How do I access components from a module.

    e.g.

    I have Form1 with that uses AxInet1 component.

    In a module I want to access that component. In VB6 all you did was:

    With Form1.Inet1
    .cancel
    .Protocol = icFTP
    .URL = "myURL.net"
    .UserName = "username"
    .Password = "password"
    End With


    The FORM1.INet1 doesn't exist in .NET so how do get it?

    Thanks for your help!

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    VB Code:
    1. dim mform as new form1()
    2. mform.inet1.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    26

    Yup ....gotta get used Classes in VB.NET

    Yup Gotta get used to Classes in .NET....thanks that worked!

  4. #4
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    ah...but u shouldnt use iNET in .NET! use system.net.sockets instead...!

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    26

    Ok I will read up on that.....why is it more reliable?

    Is this a more reliable feature of .NET?

  6. #6
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    It is a general rule with .Net to try to use the existing classes if possible. Using COM interop only when necessary. Your adding an extra layer that doesn't need to be there.

    If MS decides to port the .Net framework on other platforms besides Windows, then your code will more than likely work if you are using .Net classes and not COM components. I find the chances that .Net will be on other platforms is highly unlikely, but the possiblity is there, and if it happens, you want your code to work.

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