Generally all .NET code is type safe as that is a feature of the framework (until you venture into unsafe code development).
You would better satisfy the encapsulation principle by exposing your button text property as a propety on the form. That way the calling code doesn't need to know about the controls itself, and you could also change what is encapsulated without breaking callers.
Put a property like this in Form1:
public string ButtonText{
get{ return button1.Text; }
set{ button1.Text = value; }
}
-Peter
|