using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Systehttp://m.Threading.Tasks;
using Systehttp://m.Windows.Forms;
namespace WindowsFormsApp2
{
public partial class Form1 : Form
{
int y = 40;
int gak = 10;
List<String> listboxdata = new List<String>() { "홍길동", "박길동", "이길동" };
List<Person> personlist = new List<Person>() {
new Person(){ name = "김길동",age = 20},
new Person(){ name = "이길동",age = 30}
};
public Form1()
{
InitializeComponent();
dataGridView1.DataSource = null;
dataGridView1.DataSource = personlist;
timer1.Interval = 500;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
Console.WriteLine(Math.PI);
Console.WriteLine(Math.Cos((gak * Math.PI)/180) * 100);
Console.WriteLine(Math.Sin((gak * Math.PI)/180) * 100);
int x = 200 + (int)(Math.Cos((gak * Math.PI) / 180) * 150);
int y = 200 + (int)(Math.Sin((gak * Math.PI) / 180) * 150);
Console.WriteLine("출력");
button1.Location = new Point(10, y);
y += 40;
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.DataSource = null;
listboxdata.Add("김길동");
listBox1.DataSource = listboxdata;
}
private void button3_Click(object sender, EventArgs e)
{
}
}
}
'C#' 카테고리의 다른 글
c# 수업중 내용2 (0) | 2024.02.20 |
---|---|
파일 저장 및 불러오기 (0) | 2024.02.20 |
원 처럼 움직이기 (0) | 2024.02.19 |
라벨 이용하기 (0) | 2024.02.16 |
C# 콘솔 (0) | 2024.02.13 |