Hi @Alexandre Bisewski ,
After setting the color as a private property in class B, add two public methods getColor() and setColor().
In this way, the color property cannot be accessed directly.
Then you can read and write the color attributes in class A through the getColor() and setColor() methods of class B.
Class A
Dim test As B = New B
test.setColor(Color.Black)
Dim col = test.getColor
End Class
Class B
Public Property open As Boolean
Private Property color As Color
Public Function getColor()
Return Me.color
End Function
Public Sub setColor(ByVal color As Color)
Me.color = color
End SubEnd Class
End Class
Hope the code above could be helpful.
If I have any misunderstanding, please let me know.
Best Regards.
Jiachen Li
*
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.