0% found this document useful (0 votes)
9 views4 pages

C# Windows Forms Data Management

The document contains code for two Windows Forms applications. The first application populates a combo box with the results of multiplying integers from 1 to a given number. The second application sorts user-entered integer values into even and odd arrays, and displays them in separate combo boxes. It checks the array size does not exceed the specified capacity before adding new values.

Uploaded by

hermainaputri
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

C# Windows Forms Data Management

The document contains code for two Windows Forms applications. The first application populates a combo box with the results of multiplying integers from 1 to a given number. The second application sorts user-entered integer values into even and odd arrays, and displays them in separate combo boxes. It checks the array size does not exceed the specified capacity before adding new values.

Uploaded by

hermainaputri
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

using System;

using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];

namespace Tugas_khawa
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
[Link]();
int z;
int batas = Convert.ToInt32([Link]);

for (int i = 1; i <= batas; i++)


{
z = i * (i + 1);

[Link](z);
}
[Link] = true;
}
}
}
using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];

namespace Tugas_khawa
{
public partial class Form3 : Form
{
int a = 0, x = 0;
int[] angka;
public Form3()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
a = Convert.ToInt32([Link]);
angka = new int[a];
// ini untuk mengisi banyaknya data array
[Link] = textBox2;
}

private void button3_Click(object sender, EventArgs e)


{
for (int i = 1; i <= [Link] - 1; i++)
{
for (int j = 0; j < [Link] - 1; j++)
{
if (angka[j] < angka[j + 1])
{
int temp = angka[j + 1];
angka[j + 1] = angka[j];
angka[j] = temp;
}
}
}

for (int i = 0; i <= [Link] - 1; i++)


{
if (angka[i] % 2 == 0)

[Link](angka[i]);
else

{
[Link](angka[i]);
}
}
}

private void button2_Click(object sender, EventArgs e)


{
if (x >= a)
{
[Link]("Kapasitas Penyimpanan" + "Data Anda Tidak Cukup",
"Warning", [Link]);
}
else
{
angka[x] = Convert.ToInt32([Link]); //masukkan data ke array
[Link](angka[x]); //Memasukkan data ke comboBox 1 per 1
x++; // penambahan indeks
[Link] = ""; // Pengosongan TextBox
[Link] = textBox2; // memindahkan kursor ke textbox
}
}
}
}

You might also like