메뉴 건너뛰기

Programing

C# 게시판

파일찾기 사용하기

관리자2 2018.12.26 19:03 조회 수 : 154

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

 

namespace ts13

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

 

        private void btnOpen_Click(object sender, EventArgs e)

        {

            int fp = Convert.ToInt32(this.ofdFile.ShowDialog());

            if(fp == 1)

            {

                this.pbView.ImageLocation = this.ofdFile.FileName;

                this.hScrollBar.Enabled = true;

            }

        }

 

        private void hScrollBar_Scroll(object sender, ScrollEventArgs e)

        {

            var h = this.hScrollBar.Value;

            var w = this.hScrollBar.Value;

            this.pbView.Size = new Size(this.hScrollBar.Value * 2, this.hScrollBar.Value * 2);

        }

    }

}

열기를 누르면 파일 찾기 상자가 뜨고 파일을 선택하여 열면 스크롤바로 크기 조정이 가능하다.
위로