Results 1 to 5 of 5

Thread: Connecting to another class

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2004
    Posts
    610

    Connecting to another class

    hey guyz,
    if lets say i want to create a function and put it into a seperate class from the main form.. how do i call the function? becuase in the function that i just created... there are some objects like txtname that cannot be read from the new class

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Connecting to another class

    Its all down to access...

    Public / Protected / Private / Shared / Friend / Readonly / Writeonly / etc...
    I don't live here any more.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2004
    Posts
    610

    Re: Connecting to another class

    erm..
    so i do i correct it???
    its lets say form1 is the main class and it has a textbox inside

    i created a special class.. but it cannot access the textbox in form 1..
    how do i connect the special class with form 1?

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Connecting to another class

    You can access TextBox1 because it's in the form. As for this function in another class, just instantiate that class, and call the function from the object.

    Code:
    Dim mc As New MyClass
    TextBox1.Text = mc.FunctionNameReturningAString()

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2004
    Posts
    610

    Re: Connecting to another class

    erm...
    now i am in that special class...
    how do i call the datagrid from the form?

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