Get user input from textbox to use in class

I’m kinda new to programing and C#.

I’ve created a few testapplications and is now working on getting them together to one app. However i have a hard time getting userinput from the “MainWindow” into my classes.

I have a textbox that I want the user to write their domain-name in.

I can’t set the string to public, i guess since the textbox it self is not public.

I’m assuming i have to do like this.

string UrDomain = txtDomain.Text;

public string Domain () { get { return Value} set { UrDomain = Value } }

Then get the “Value” by this in the class.

string usrDomain = MainWindow.UrDomain();

I still can’t get it to work after multiple hours.. Any suggestions?

submitted by /u/Zleeper95
[link] [comments]

Leave a Reply