예제 #1
0
파일: FrmCombe.cs 프로젝트: Ghcsm/Wh_Fzg
        private void butImgLoad_Click(object sender, EventArgs e)
        {
            if (txtPage.Text.Trim().Length <= 0)
            {
                return;
            }
            int  p;
            bool bl = int.TryParse(txtPage.Text.Trim(), out p);

            if (!bl)
            {
                MessageBox.Show("页码不正确无法加载!");
                txtPage.Focus();
                return;
            }
            if (p > ImgPage)
            {
                MessageBox.Show("页码超出范围无法加载!");
                txtPage.Focus();
                return;
            }
            Bitmap b = Himg.Getbmp(file, p);

            if (b == null)
            {
                MessageBox.Show("加载图像文件失败!");
                txtPage.Focus();
                return;
            }
            bmp.Add(b);
            lbImgPage.Items.Add(p.ToString());
        }