forms - How to change variable values between namespaces / classes? -
i have main form textbox1 string value : asd
namespace crystal { public partial class mainform : form { //here textbox1 text "asd" } }
i want change textbox1 text class:
namespace crystal.utilities { public class logging { //textbox1.text = "dsa"; } }
the problem is, cant change value of textbox1 logging class, because doesnt exists there :/ how this?
don't need expose entire textbox - don't want others mess other things text, , think it's more readable , simple call method that, instead of accessing textbox directly.
namespace crystal { public partial class mainform : form { public void settextbox1text(string newtext) { textbox1.text=newtext } } } namespace crystal.utilities { public class logging { mainform.settextbox1text("new text"); } }
Comments
Post a Comment