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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started