0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

cscの作法 その532

Posted at

概要

cscの作法、調べてみた。
練習問題やってみた。

練習問題

buttonに画像を使え。

写真

image.png

サンプルコード


using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace App
{
	public partial class Form1: Form {
		Button button1;
		public Form1() {
			Text = "button";
			ClientSize = new Size(400, 400);
			button1 = new Button();
			button1.Location = new Point(50, 50);
			button1.Size = new Size(250, 50);
			button1.Click += new EventHandler(button1_Click);
			button1.Image = Image.FromFile("cat8.png");
			this.Controls.Add(button1);
		}
		private void button1_Click(object sender, EventArgs e) {
			Console.WriteLine("ok0");
		}
		[STAThread]
		public static void Main() {
			Application.Run(new Form1());
		}
	}
}





以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?