Button Array - which one is pressed? c# - c#

I tried to dynamically create an array of buttons and i cant quite figure out how i can let a function know which button actually was pressed.. i tried it this way but it does not seem to work out. Any ideas?
public void game_setup(int columns, int rows, int mines)
{
//game_destroy();
//Set Window Size
this.Height = 50 + Options.y_ini + rows * (Options.size + Options.space);
this.Width = 20 + 2 * Options.x_ini + columns * (Options.size + Options.space);
//Setup the playing field
Button[,] field = new Button[columns,rows];
for (int i = 0; i < columns; i++)
{
for (int j = 0; j < rows; j++)
{
field[i, j] = new Button();
//Button Size
field[i, j].Width = Options.size;
field[i, j].Height = Options.size;
//Button Position
int x = Options.x_ini + i * (Options.size + Options.space);
int y = Options.y_ini + j * (Options.size + Options.space);
field[i, j].Location = new Point(x, y);
//Event Handler
int send_i = i;
int send_j = j;
field[i, j].Click += (sender, args) =>
{
field_Click(send_i, send_j);
};
//Add the Button to the GameBoard
Controls.Add(field[i, j]);
}
}
//Distribute the Mines
//...
}
public void field_Click(int x, int y)
{
MessageBox.Show("X:" + x + " Y:" + y);
field[1, 2].Text = "hi";
}

Change your event handler to pass on the sender parameter. This is a reference to the button that was clicked.
field[i, j].Click += (sender, args) =>
{
field_Click(sender, send_i, send_j);
};
public void field_Click(object sender, int x, int y)
{
Button btn = sender as Button;
MessageBox.Show(btn.Name + "X:" + x + " Y:" + y);
field[x, y].Text = "hi";
}

field[i, j].Tag = new Point(send_i, send_j);
field[i, j].Click += (sender, args) => {
Button button = sender as Button;
Point p = (Point) button.Tag;
field_Click(p.X, p.Y);
};
NOTE: the point is you can access the actual clicked Button via the sender, just cast it to Button and you can do everything with the clicked Button.

field[i, j].Name = i +j';
field[i, j].Click += (sender, args) =>
{
field_Click(sender, send_i, send_j);
};
public void field_Click(object theButton, int x, int y)
{
var currentButton = (Button) sender;
if ( currentButton.Name == YOUR CODE HERE IF YOU WANT TO CHECK SOMETHING)
{
MessageBox.Show("X:" + x + " Y:" + y);
field[1, 2].Text = "hi";
}
}

What you want to do is just have X and Y when the click happen. You don't need to do much.
First use a very standard click event.
then replace this :
int send_i = i;
int send_j = j;
field[i, j].Click += (sender, args) =>
{
field_Click(send_i, send_j);
};
With this
field[i, j].Tag = i.ToString() + "|" + j.ToString();
field[i, j].Click += new EventHandler(field_Click);
Now change the event handler to be the following
private void field_Click(object sender, EventArgs e)
{
string[] sSplitTag = ((Button)sender).Tag.ToString().Split('|');
int i = Convert.ToInt32(sSplitTag[0]);
int j = Convert.ToInt32(sSplitTag[1]);
}
Always try to use the tag to know detail about who your control is. it's what this property is made for... tagging you control so you can recognize him when you see him again.

Related

C# - Dynamic buttons with dynamic data-entering

I have a bit of an issue here.
I'm trying to create dynamic clickevents with variable data.
for(int i = 0; i < data.Devices.Length; i++)
{
Button _button = new Button();
_button.Size = new Size(100, 15);
_button.Text = data.Devices[i].Alias;
_button.Name = "textbox" + i.ToString();
_button.Location = new Point(x,y);
x += 110;
if(x > 1850)
{
y += 50;
x = 10;
}
if (data.Devices[i].OnlineState == "Online")
{
_button.BackColor = Color.Green;
}
else
{
_button.BackColor = Color.Red;
}
_button.Click += (Sender, args) =>
{
MessageBox.Show(data.Devices[i].Alias);
};
Controls.Add(_button);
}
The idea here is that I'll create buttons until length of the list is done (The list and position of these objects vary).
What I'm looking for is to make a bunch of buttons, and when you click on the button there should you'll open another screen with some statistics attached to that object.
Since the data will vary A LOT there is no way to hardcode each scenario, but instead I'm looking to do the same thing as you can do in Android, see below.
for (int i = 1; i <= 20; i++) {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
Button btn = new Button(this);
btn.setId(i);
final int id_ = btn.getId();
btn.setText("button " + id_);
btn.setBackgroundColor(Color.rgb(70, 80, 90));
linear.addView(btn, params);
btn1 = ((Button) findViewById(id_));
btn1.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Toast.makeText(view.getContext(), "Button clicked index = " + id_, Toast.LENGTH_SHORT).show();
}
});
Is there any way I can achieve this?
Kind Regards.
I think the problem you are experiencing is regarding closures.
In your example you are adding the event handler with a delegate that's referencing the variable i which changes each loop iteration. So when the event handler is actually executed (when the button is clicked) i is out of scope.
You could do something like this:
private void Form1_Shown(object sender, EventArgs e)
{
var items = new[] { "Item One", "Item Two", "Item Three", "Item Four", "Item Five" };
for (int i = 0; i < items.Length; i++)
{
var btn = new Button
{
Text = $"Button {i + 1}",
Tag = items[i]
};
btn.Click += (object obj, EventArgs args)
=>
{
MessageBox.Show($"Hello. {((Button)obj).Tag}");
};
flowLayoutPanel1.Controls.Add(btn);
}
}
In your case - the button's tag can be set to data.Devices[i] - in other words it doesn't have to be a string it can be an object.
I start off by creating the buttons with the and placing them on the screen.
for (int i = 0; i < data.Devices.Length; i++){
Button _button = new Button();
_button.Size = new System.Drawing.Size(100, 55);
_button.Text = data.Devices[i].Alias;
_button.Name = "dynamicButton";
_button.FlatStyle = FlatStyle.Flat;
_button.Tag = data.Devices[i].Alias + "|" +
data.Devices[i].DeviceId + "|" +
data.Devices[i].LastSeen + "|" +
data.Devices[i].OnlineState + "|" +
data.Devices[i].Description + "|" +
data.Devices[i].RemotecontrolId;
_button.Location = new System.Drawing.Point(x, y);
x += 110;
if (x > 1850)
{
y += 60;
x = 30;
}
_button.Click += new EventHandler(bt_click);
Controls.Add(_button);
}
And then using the onclick event.
protected void bt_click(object sender, EventArgs e)
{
Button btn = sender as Button;
String[] information = btn.Tag.ToString().Split('|');
String present = "Namn: " + information[0]
+ "\nDeviceID: " + information[1]
+ "\nSenast uppe: " + information[2]
+ "\nStatus: " + information[3]
+ "\nEmail: " + information[4]
+ "\nTW-ID: " + information[5];
MessageBox.Show(present);
//DO THE THINGS WITH THE INFORMATION
}
And then to unload everything and eventually updating the status of the device.
for (int i = 0; i < 10; i++)
{
foreach (Control item in Controls.OfType<Control>())
{
if (item.Name == "dynamicButton")
{
Controls.Remove(item);
}
}
}
For some reason I have to loop that thing a couple of times, beacuse it won't delete them all, but instead deleting them in some pattern.
(only takes every other one each time)
I looped it 10 times for good measures.
It does exactly what I want it to do, and new devices gets added automaticly and removed devices dissapears just as fast.

How to use properties of text boxes outside of the current context in visual studio [duplicate]

I have created WinForm App in which user can set how many textboxes he want (Range 1-99)
I am using this code to create Textboxes during runtime
for (int i = 0; i < Calculation.Num; i++)
{
TextBox txtRun = new TextBox();
txtRun.Name = "txtBox" + i;
txtRun.Location = new System.Drawing.Point(35, 50 + (20 * i) * 2);
txtRun.Size = new System.Drawing.Size(75, 25);
this.Controls.Add(txtRun);
}
Suppose user create 2 textboxes and then enter data in each textbox and click calculate button
Now i want to get the textboxes data and divide it by 100
See The Picture I want txtbox1 and txtbox2 data
EDIT 3:
This is the Whole Code
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 GPA_Calculatior__New_
{
public partial class Form1 : Form
{
int j = 0;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//Label + Marks Obtained Textbox
for (int i = 0; i < Calculation.Num; i++)
{
Label lblCount = new Label();
lblCount.Name = "lblCount" + i;
lblCount.Location = new System.Drawing.Point(5, 55 + (20 * i) * 2);
lblCount.Size = new System.Drawing.Size(20, 30);
lblCount.Text = (i + 1).ToString();
this.Controls.Add(lblCount);
TextBox txtRun = new TextBox();
txtRun.Name = "txtBox" + i;
txtRun.Location = new System.Drawing.Point(35, 50 + (20 * i) * 2);
txtRun.Size = new System.Drawing.Size(75, 25);
this.Controls.Add(txtRun);
}
//Creating Textbox which is for total marks
for (j = 0; j < Calculation.Num; j++)
{
TextBox txtRun = new TextBox();
txtRun.Name = "TotaltxtBox" + j;
txtRun.Location = new System.Drawing.Point(160, 50 + (20 * j) * 2);
txtRun.Size = new System.Drawing.Size(50, 25);
txtRun.Text = "100";
txtRun.Enabled = false;
this.Controls.Add(txtRun);
}
// Creating 2 Buttons (Calculate and Back)
for (int k = 0; k < 2; k++)
{
Button Btn = new Button();
Btn.Name = "btn" + k;
Btn.Location = new System.Drawing.Point(20 + (k *110), 60 + (20 * j) * 2);
Btn.Size = new System.Drawing.Size(90, 30);
if (k == 0)
Btn.Text = "Back";
else
Btn.Text = "Calculate";
Btn.Click += button_Click;
this.Controls.Add(Btn);
}
//Just for Giving free space in last
Label lbl = new Label();
lbl.Name = "lbl" + j;
lbl.Location = new System.Drawing.Point(30, 90 + (20 * j) * 2);
lbl.Size = new System.Drawing.Size(90, 30);
lbl.Text = "";
this.Controls.Add(lbl);
//**********************************************
}
//Caculate and back button function
private void button_Click(object sender, EventArgs e)
{
Button btn = sender as Button;
if (btn.Name.Equals("btn1"))
{
for (int i = 0; i < Calculation.Num; i++)
{
}
}
else
{
GPA_Calculator mainForm = new GPA_Calculator();
mainForm.Show();
this.Hide();
}
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
for (j = 0; j < 10; j++)
{
}
}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
Application.Exit();
}
}
}
var sum = this.Controls.OfType<TextBox>()
.Where(t => char.IsDigit(t.Name.Reverse().Take(1).FirstOrDefault())
&& t.Enabled)
.Select(t =>
{
double i;
if (!double.TryParse(t.Text, out i)) { return 0d; }
return i / 100d;
})
.Sum();
This may work, I built a separate class to store the control and its value, then you can work out the values independently from the rest of the form. You need to trigger the calculations though:
private List<InfoTextBox> activeTextBoxes = new List<InfoTextBox>();
public Form1()
{
for (int i = 0; i < Calculation.Num; i++)
{
TextBox txtRun = new TextBox();
txtRun.Name = "txtBox" + i;
txtRun.Location = new System.Drawing.Point(35, 50 + (20 * i) * 2);
txtRun.Size = new System.Drawing.Size(75, 25);
this.Controls.Add(txtRun);
InfoTextBox iBox = new InfoTextBox();
iBox.textbox = txtRun;
activeTextBoxes.Add(iBox);
}
}
public class InfoTextBox
{
private double _textboxValue;
public TextBox textbox { get; set; }
public double TextBoxValue { get { return _textboxValue; } set { _textboxValue = setValue(value); } }
private double setValue(double invalue)
{
return invalue / 100;
}
}

How to create click event handler for a dynamic 2D array of buttons in C#

I need to generate a 2D "card" of buttons dynamically. How would I go about giving each one an event handler and being able to reference the button directly?
public void generateButtonsCard(Panel cardPanel)
{
for (int y = 0; y <= 4; y++)
{
for (int x = 0; x <= 4; x++)
{
cardButtons[x, y] = new Button();
cardButtons[x, y].Size = new Size(80, 80);
cardButtons[x, y].Name = "btn" + x + "" + y;
cardButtons[x, y].Location = new Point(80 * x, 80 * y);
cardPanel.Controls.Add(cardButtons[x, y]);
}
}
RNGCard();
cardButtons[2, 2].Text = "Free Space";
}
If you're dynamically creating buttons then you should dynamically create the event handlers. Creating a void btn_Click(object sender, EventArgs e) goes against good OO design - you want to encapsulate code and not leave it out there for any code to call.
Here's how:
public void generateButtonsCard(Panel cardPanel)
{
for (int y = 0; y <= 4; y++)
{
for (int x = 0; x <= 4; x++)
{
var button = new Button();
button.Size = new Size(80, 80);
button.Name = "btn" + x + "" + y;
button.Location = new Point(80 * x, 80 * y);
button.Click += (s, e) =>
{
/* Your event handling code here
with full access to `button` above */
};
cardPanel.Controls.Add(button);
cardButtons[x, y] = button;
}
}
RNGCard();
cardButtons[2, 2].Text = "Free Space";
}
The handler is encapsulated within the generateButtonsCard method and you have full access to the button instance within the handler. It's neat and tidy.
Try this,
public void generateButtonsCard(Panel cardPanel)
{
for (int y = 0; y <= 4; y++)
{
for (int x = 0; x <= 4; x++)
{
cardButtons[x, y] = new Button();
cardButtons[x, y].Size = new Size(80, 80);
cardButtons[x, y].Name = "btn" + x + "" + y;
cardButtons[x, y].Location = new Point(80 * x, 80 * y);
cardButtons[x, y].Click += btn_Click;
cardPanel.Controls.Add(cardButtons[x, y]);
}
}
RNGCard();
cardButtons[2, 2].Text = "Free Space";
}
private void btn_Click(object sender, EventArgs e){
Button b = sender as Button;
//if (b.Name == "1")
//{
label1.Text = b.Name.ToString();
//}
}
Result;
At Click event, sender represents the button. You can check your random variables with button's properties like commented area. (In result image there is not if condition btw.)
Hope helps,
So you can create a single button click event handler, and inside that handler you can switch your logic based on which button was clicked. Here is an example of how to do it:
public class XYButton : Button
{
private int xPos;
private int yPos;
public XYButton(int x, int y)
{
xPos = x;
yPos = y;
}
public int GetX()
{
return xPos;
}
public int GetY()
{
return yPos;
}
}
Then using this new extension of button...
public void generateButtonsCard(Panel cardPanel)
{
for (int y = 0; y <= 4; y++)
{
for (int x = 0; x <= 4; x++)
{
cardButtons[x, y] = new XYButton(x,y);
cardButtons[x, y].Size = new Size(80, 80);
cardButtons[x, y].Name = "btn" + x + "" + y;
cardButtons[x, y].Location = new Point(80 * x, 80 * y);
cardButtons[x, y].Click += btn_Click;
cardPanel.Controls.Add(cardButtons[x, y]);
}
}
RNGCard();
cardButtons[2, 2].Text = "Free Space";
}
private void btn_Click(object sender, EventArgs e){
var xyButton = sender as XYButton;
// now you can get the x and y position from xyButton.
}

C# - How can I create 2 separate button arrays with different controls without them causing problems with the other?

I am currently trying to develop a form of battleships on c# windows form.
Here is the code I am trying to use.. the trouble I have been having is how to create a second set of buttons (another 10x10) behind the other, with two sets of controls so I can switch between the two.
I have everything like AI and automated setups, I just need to have 2 button controls. I hope someone can help me out with this! Many thanks!
private List<List<Button>> grid = new List<List<Button>>();
public UserForm()
{
InitializeComponent();
byte numRows = 10;
byte numCols = 10;
for (byte i = 0; i < numRows; i++)
{
grid.Add(ButtonRowCreator(numCols, 25, (i+1) * 50));
}
}
public List<Button> ButtonRowCreator(byte numOfBtnsNeeded, int x, int y)
{
List<Button> btns = new List<Button>();
for (int i = 0; i < numOfBtnsNeeded; i++)
{
Button btn = new Button();
btn.Size = new Size(50, 50);
btn.Location = new Point(x + (i * btn.Width), y);
btns.Add(btn);
btn.Font = new Font("Georiga", 10);
this.Controls.Add(btn);
btn.Click += new EventHandler(btn_Click);
}
return btns;
}
void btn_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;
int curRow = -1, curCol = -1;
for(int i = 0; i < grid.Count; i++)
{
int index = grid[i].IndexOf(btn);
if (index != -1)
{
curRow = i;
curCol = index;
Console.WriteLine("curRow = " + curRow.ToString() + ", curCol = " + curCol.ToString());
}
}
// ... now you can use "curRow", "curCol" and "grid" to do something ...
foreach (List<Button> row in grid)
{
foreach (Button col in row)
{
col.ForeColor = Color.Gray;
}
}
if (board[curRow, curCol] == 1)
{
if (btn.Text == "Hit")
{
}
else
{
btn.Text = "Hit";
btn.BackColor = Color.Red;
hit++;
}
if (hit == 17)
{
MessageBox.Show("Congratulations, You Sunk Their Battleships!");
MessageBox.Show("Thanks For Playing!");
MessageBox.Show("Goodbye!");
}
}
else
{
btn.Text = "Miss!";
btn.BackColor = Color.Blue;
}
I think this is what you're after?
It looks like a lot of your code is used to figure out what button is clicked on. This information can be stored on the button object itself in the Tag property and greatly simplifies the code.
private Button[,] _grid1;
private Button[,] _grid2;
public UserForm()
{
InitializeComponent();
_grid1 = new Button[10, 10];
_grid2 = new Button[10, 10];
CreateGrid(_grid1, 10, 10, 25, 0, 20, true);
CreateGrid(_grid2, 10, 10, 25, 250, 20, false);
}
public void CreateGrid(Button[,] grid, int numOfRows, int numOfCols, int offsetX, int offsetY, int buttonSize, bool enabled)
{
for (byte i = 0; i < numOfRows; i++)
{
for (byte j = 0; j < numOfCols; j++)
{
grid[i,j] = ButtonCreator(i, j, offsetX, offsetY, buttonSize, enabled);
}
}
}
public Button ButtonCreator(int row, int col, int x, int y, int buttonSize, bool enabled)
{
Button btn = new Button();
btn.Size = new Size(buttonSize, buttonSize);
btn.Location = new Point(x + (col * buttonSize), y + (row * buttonSize));
btn.Font = new Font("Georiga", 10);
this.Controls.Add(btn);
btn.Click += new EventHandler(btn_Click);
btn.Tag = row + "," + col;
btn.Enabled = enabled;
return btn;
}
void btn_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;
string[] coord = btn.Tag.ToString().Split(',');
int curRow = Convert.ToInt32(coord[0]);
int curCol = Convert.ToInt32(coord[1]);
Console.WriteLine(curRow = " + curRow + ", curCol = " + curCol);
// ... now you can use "curRow", "curCol" to do something ...
_grid1[curRow, curCol].BackColor = Color.Red;
}

Get real time input from programmatically generated elements in C# form

How to get value of checkboxes (and the textbox upon change in text) in real time with form particulars that are all generated via code?
This following code produces a form upon button press, the form has checkboxes and a richtextbox. Ideally I want any interaction to have an effect, so if I paste in a grid of ones and zeros the checkboxes update, and once a checkbox gets click, the corresponding one or zero in the textarea will update (So that I can then copy the grid (matrix) out and into another program.
I know how to get the events using the visual studio GUI maker, but not from a programmatically created form like this.
private void begin_button_Click(object sender, EventArgs e)
{
// Build the child form
Form check_box = new Form();
check_box.FormBorderStyle = FormBorderStyle.FixedSingle;
// Get the values from the textboxes
int height = Convert.ToInt16(this.height_input.Text);
int width = Convert.ToInt16(this.width_input.Text);
// Set the dimensions of the form
check_box.Width = width * 15 + 40;
check_box.Height = ( height * 15 + 40 ) * 3;
// Build checkboxes for the checkbox form
CheckBox[] chk;
chk = new CheckBox[height * width];
int count = 0;
for (int i = 1; i <= height; i++)
{
for (int j = 1; j <= width; j++)
{
chk[count] = new CheckBox();
chk[count].Name = count.ToString();
chk[count].Width = 15; // because the default is 100px for text
chk[count].Height = 15;
chk[count].Location = new Point(j * 15, i * 15);
chk[count].CheckedChanged += new EventHandler(this.CheckedChanged);
check_box.Controls.Add(chk[count]);
count += 1;
//Console.WriteLine(" i: " + i + " j: " + j + " Count: " + count);
}
}
RichTextBox output_area;
output_area = new RichTextBox();
output_area.Location = new Point(chk[0].Location.X, chk[count-1].Location.Y + 30);
check_box.Controls.Add(output_area);
output_area.Text = "hello world\n1,1,1,1,1,1,1,1,1\n0,0,0,0,0,1,0,1\nthese ones and zeros are meant to update in real time!";
output_area.Width = check_box.Width - 40;
output_area.Height = check_box.Height / 2;
// Run the form
check_box.ShowDialog();
}
EDIT:
I have added the event handler and it's working, however I can't access the checkbox form, only the main form.
private void CheckedChanged(object sender, EventArgs e)
{
//throw new NotImplementedException();
CheckBox x = (CheckBox)sender;
Console.WriteLine(x);
Console.WriteLine(x.Name.ToString());
}
Have a look at the .Designer file that the form designer generates for you!
Anyway, in your loop, try something like this:
chk[count].CheckedChanged += MyFancyHandler;
And the handler itself will look just like a normal handler:
private void MyFancyHandler( object sender, EventArgs e )
{
// ...
}
Also notice that the sender argument there will contain a reference to whichever checkbox/control the event refers to.
Below code updates matrix text in the rich text box when check box check state changed.
RichTextBox output_area;
CheckBox[] chk;
Size MatrixSize;
private void begin_button_Click()
{
// Build the child form
Form check_box = new Form();
check_box.FormBorderStyle = FormBorderStyle.FixedSingle;
check_box.StartPosition = FormStartPosition.CenterScreen;
// Get the values from the textboxes
int height = Convert.ToInt16("10");
int width = Convert.ToInt16("7");
MatrixSize = new Size(width, height);
// Set the dimensions of the form
check_box.Width = width * 15 + 40;
check_box.Height = (height * 15 + 40) * 3;
// Build checkboxes for the checkbox form
chk = new CheckBox[height * width];
int count = 0;
for (int i = 1; i <= height; i++)
{
for (int j = 1; j <= width; j++)
{
chk[count] = new CheckBox();
chk[count].Name = count.ToString();
chk[count].Width = 15; // because the default is 100px for text
chk[count].Height = 15;
chk[count].Location = new Point(j * 15, i * 15);
check_box.Controls.Add(chk[count]);
chk[count].CheckedChanged += new EventHandler(CheckBox1_CheckedChanged);
count += 1;
//Console.WriteLine(" i: " + i + " j: " + j + " Count: " + count);
}
}
output_area = new RichTextBox();
output_area.Location = new Point(chk[0].Location.X, chk[count - 1].Location.Y + 30);
check_box.Controls.Add(output_area);
output_area.Text = "hello world\n1,1,1,1,1,1,1,1,1\n0,0,0,0,0,1,0,1\nthese ones and zeros are meant to update in real time!";
output_area.Width = check_box.Width - 40;
output_area.Height = check_box.Height / 2;
// Run the form
check_box.ShowDialog();
}
private void CheckBox1_CheckedChanged(Object sender, EventArgs e)
{
CheckBox c = (CheckBox)sender;
Debug.WriteLine(c.Name);
StringBuilder sb = new StringBuilder();
int count = 0;
for (int i = 1; i <= MatrixSize.Height; i++)
{
for (int j = 1; j <= MatrixSize.Width; j++)
{
if (chk[count].Checked)
{
sb.Append("1,");
}
else
{
sb.Append("0,");
}
count += 1;
}
sb.Append("\r\n");
}
output_area.Text = sb.ToString();
}

Categories