|
-
Feb 1st, 2005, 10:18 AM
#1
Thread Starter
Fanatic Member
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
-
Feb 1st, 2005, 10:31 AM
#2
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.
-
Feb 1st, 2005, 10:35 AM
#3
Thread Starter
Fanatic Member
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?
-
Feb 1st, 2005, 10:46 AM
#4
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()
-
Feb 1st, 2005, 11:09 AM
#5
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|