I am trying to create an object that has several "Dimensions". 'For example, a text box has the following properties:
MyTextBox.Font.Bold
How would I go about making the above properties?
What about assigning values?
Printable View
I am trying to create an object that has several "Dimensions". 'For example, a text box has the following properties:
MyTextBox.Font.Bold
How would I go about making the above properties?
What about assigning values?
Hi,
Not sure what you are asking here.
If you are creating a new class, you can inherit from the appropriate windows class and add any extras you require.
You can set the values of the properties at design time and, if you do not want anyone to change them, you can make them "read only".
Have you checked out the MSDN Help under "Classes"?
This isn't compilable code, but all the text box is doing under the covers is something like this:
Dim m_Font as Font
Public Property Font() As Font
Get
Return m_Font
End Get
Set (value As Font)
m_Font = value
EndSet
Basically it is holding a private font object (which has its own properties) and exposes it through a property.
Here, this project will show you what I mean, the code compiles fine...