Skip to content

Instantly share code, notes, and snippets.

@mrgarita
Created November 15, 2017 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrgarita/8ecb75f70070eb282191441993e64a1e to your computer and use it in GitHub Desktop.
Save mrgarita/8ecb75f70070eb282191441993e64a1e to your computer and use it in GitHub Desktop.
C#:外部フォルダに配置した画像をピクチャボックスに表示する
using System;
using System.Windows.Forms;
namespace 画像をピクチャボックスに表示する
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.Text = Application.ProductName;
button1.Text = "Before";
button2.Text = "After";
}
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.ImageLocation = @"c:\image\before.jpg";
}
private void button2_Click(object sender, EventArgs e)
{
pictureBox1.ImageLocation = @"c:\image\after.jpg";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment