プロが教える店舗&オフィスのセキュリティ対策術

JScript .NET に関する質問なので、カテゴリが違うと思いますが、ご存知の方がいらっしゃったらよろしくお願いします。

import Accessibility;
import System.Drawing;
import System.Windows.Forms;

new Form1().ShowDialog();

class Form1 extends Form {
function Form1() {
Text = "Form1";
BackColor = SystemColors.Window;
ForeColor = SystemColors.WindowText;
ResizeRedraw = true;
}

protected function OnPaint(e) {
var g = e.Graphics;
var pen = new Pen(ForeColor);
g.DrawLine(pen, 0, 0, ClientSize.Width - 1, ClientSize.Height - 1);
g.DrawLine(pen, 0, ClientSize.Height - 1, ClientSize.Width - 1, 0);
}
}

A 回答 (2件)

描画メソッドですが。



protected override function OnPaint(e:PaintEventArgs) {
var g = e.Graphics;
var pen = new Pen(ForeColor);
var w = ClientSize.Width;
var h = ClientSize.Height;
g.DrawLine(pen, new Point(0,0), new Point(w - 1,h - 1));
g.DrawLine(pen, new Point(0, h - 1), new Point(w - 1, 0));
}

これではどうでしょう?
    • good
    • 0

JScriptはよくわかりませんが、普通の.NETで検索すればいいのかな。



http://msdn.microsoft.com/library/ja/default.asp …

JScriptでは、ペイントイベントの独自定義ができないとかかれていますが、関係ありそうですか?
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!