Question
How do i display results in a windows form in visual studio? Can it be displayed in a textbox which i am using? Or would
How do i display results in a windows form in visual studio? Can it be displayed in a textbox which i am using? Or would it have to be a label? Or would it be easier to generate a new window to show the results? Im trying to figure out the equivalent to a console application that has the line of code of : Console.WriteLine("Pattern found at:{0}", x);
I have my code below that runs, but i am trying to figure out how to display the results back to the screen. Help and proof of working code with screenshots will be best to show it works.
Form1.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;
namespace trial1 { public partial class Form1 : Form { DISPLAY display;
public Form1() { InitializeComponent(); display = new DISPLAY(enter1.Text);
//display.InputPattern(); mydisplay1.Text = display.returnScreenValue(); }
private void button1_Click(object sender, EventArgs e) { //i need the text entered in enter1.Text to be read in as the pattern display.RandomGenerator(); display.bruteforce(); mydisplay1.Text = display.returnScreenValue(); }
} }
DISPLAY.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;
namespace trial1 { public partial class Form1 : Form { DISPLAY display;
public Form1() { InitializeComponent(); display = new DISPLAY(enter1.Text);
//display.InputPattern(); mydisplay1.Text = display.returnScreenValue(); }
private void button1_Click(object sender, EventArgs e) { //i need the text entered in enter1.Text to be read in as the pattern display.RandomGenerator(); display.bruteforce(); mydisplay1.Text = display.returnScreenValue(); }
} }
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