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
Re: Connecting to another class
Its all down to access...
Public / Protected / Private / Shared / Friend / Readonly / Writeonly / etc...
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?
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()
Re: Connecting to another class
erm...
now i am in that special class...
how do i call the datagrid from the form?