C#, C♯, C#相談室 Part51 at TECH
[2ch|▼Menu]
868:デフォルトの名無しさん
09/03/21 01:33:51
>>862
ピンポンの動きはよく分からんが、
こんな感じのものを作りたい?
using System;
using System.Drawing;
using System.Windows.Forms;
namespace circ {
public class MainForm : Form {
Timer timer;
int x;
int y;
public MainForm() {
Paint += new PaintEventHandler(MainForm_Paint);
timer = new Timer();
timer.Tick += new EventHandler(timer_Tick);
timer.Interval = 500;
timer.Enabled = true;
}
void MainForm_Paint(object sender, PaintEventArgs e) {
e.Graphics.DrawArc(Pens.Green, x, y, 10, 10, 0, 360);
}
void timer_Tick(object sender, EventArgs e) {
x = (x + 10) % Width;
y = (y + 20) % Height;
Invalidate();
}
}
}


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5374日前に更新/228 KB
担当:undef