Question: How do i read in what is inputted into a text box in Visual Studio? Do i need to call a stream? I have the

How do i read in what is inputted into a text box in Visual Studio? Do i need to call a stream? I have the below code, but i keep getting an error. I have a Form1.cs & ProgramTest.cs. I want to read what is written into the enter.txt and convert it to a string that can be read. But i am having trouble trying to have both cs files communicate with each other.

When i did a console application i could use the following bolded code, but this doesnt work with a Visual Studio form. What is the equivalent code to read in text in a form??

pattern = (Console.ReadLine()).ToUpper(); //read user input

Form 1.cs

DISPLAY display;

public Form1() { InitializeComponent(); display = new DISPLAY();

//i want what is inputted through the enter1.text to be read through the inputPattern in program.cs

display.InputPattern();

mydisplay1.Text = display.returnScreenValue(); }

Program.cs

public String inputValue { get; set; }

public String InputPattern() { inputValue = pattern; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!