Can anyone brefly explain how to do object orinted programing in VB6, even a simple exampl with just private, and public functions, and private and public vars, and i dont know if one is needed, but a constructor. Thank you very much.
Printable View
Can anyone brefly explain how to do object orinted programing in VB6, even a simple exampl with just private, and public functions, and private and public vars, and i dont know if one is needed, but a constructor. Thank you very much.
I don't think you can make contructors in vb6, you just use new keyword to create objects.
Place a classmodule in your project and add a private and a public variable:
You can of course declare a public variable public but it won't gain anything (except for time), vb does automatically make a property of it anyway.Code:private privatevar as long
private ppublicvar as long
Property Get publicvar() as long
publicvar=ppublicvar
end property
Property Let publicvar(newvalue as long)
ppublicvar=newvalue
end property
What does property let and get do? Like say I wanted to do this, I hope you know some C++
class
{
private:
int X;
int Y;
int HI(int X);
public:
bool GetThis();
bool YN;
};
How could I do something like that but VB6?