I'm creating a class diagram for my project, which is a c# solution.
I think that textbox, button, etc.. are represented in the attribute section of the class.
I've used classes like Directory, StreamReader, etc...
Should I represent them as normal classes? If so, what is the relationship between them and the class that uses them (ex : MainWindow)?
In such cases I use stereotypes like <<directory>>
, <<button>>
etc. to make the use of the class more clear. The relation between your classes should be normal associations. You could use composition for windows that are composed of buttons, fields, etc.
The following shows two different button types which inherit from a general Button
class and a text field composed in a window: