| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using O2S.Components.PDFView4NET;
- using UAS_MES.PublicMethod;
- using O2S.Components.PDFView4NET.Text;
- namespace UAS_MES.CustomControl
- {
- public partial class PDFOperater : UserControl
- {
- private PDFPageView PageView1;
- public PDFPageView PageView
- {
- get
- {
- return PageView1;
- }
- set
- {
- PageView1 = value;
- }
- }
- public PDFOperater()
- {
- InitializeComponent();
- for (int i = 1; i <= 20; i++)
- {
- ZoomComBox.Items.Add(i * 10);
- }
- }
- private void PDFOperater_Load(object sender, EventArgs e)
- {
- PageView1.Zoom = double.Parse(ZoomComBox.Text);
- }
- private void ZoomComBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- PageView1.Zoom = double.Parse(ZoomComBox.Text);
- }
- private void ZoomComBox_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- PageView1.Zoom = double.Parse(ZoomComBox.Text);
- }
- }
- private void ScrollSpan_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- ScrollTimer.Interval = int.Parse(ScrollSpan.Text) * 1000;
- ScrollTimer.Start();
- BaseUtil.SetCacheData("ScrollSpan", ScrollSpan.Text);
- }
- }
- private void ScrollTimer_Tick(object sender, EventArgs e)
- {
- if (PageView1.Document.PageCount - 1 == PageView1.PageNumber)
- {
- PageView1.GoToFirstPage();
- }
- else
- {
- PageView1.GoToNextPage();
- }
- }
- private void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- PageView1.SearchText(KeyWord.Text, PDFHighlightSearchResultsMode.AllResults);
- }
- }
- }
- }
|