七行プログラミング part3

このエントリーをはてなブックマークに追加
430278
>>420
トイレでガンバッてたら、namespace使うのを思いついた。
「釣りバカ」の>>24も参考にさせてもらいました。
namespace System{using Drawing;using Windows.Forms;class B:Form{void c(object
o,EventArgs e){OpenFileDialog d=new OpenFileDialog();if((int)d.ShowDialog()==1
){b=new Bitmap(d.FileName);AutoScrollMinSize=b.Size;Refresh();}}protected
override void OnPaint(PaintEventArgs e){if(b!=null)e.Graphics.DrawImage(b,new
Rectangle(AutoScrollPosition,b.Size));}Bitmap b;[STAThread]static void Main(){
Application.Run(new B());}B(){Menu=new MainMenu(new MenuItem[]{new MenuItem(
"&File",new MenuItem[]{new MenuItem("&Open...",new EventHandler(c))})});}}}