PDFOperater.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using O2S.Components.PDFView4NET;
  10. namespace UAS_MES.CustomControl
  11. {
  12. public partial class PDFOperater : UserControl
  13. {
  14. private PDFPageView PageView1;
  15. public PDFPageView PageView
  16. {
  17. get
  18. {
  19. return PageView1;
  20. }
  21. set
  22. {
  23. PageView1 = value;
  24. }
  25. }
  26. public PDFOperater()
  27. {
  28. InitializeComponent();
  29. for (int i = 1; i <= 20; i++)
  30. {
  31. ZoomComBox.Items.Add(i * 10);
  32. }
  33. }
  34. private void ZoomComBox_SelectedIndexChanged(object sender, EventArgs e)
  35. {
  36. PageView1.Zoom = double.Parse(ZoomComBox.Text);
  37. }
  38. private void ZoomComBox_KeyDown(object sender, KeyEventArgs e)
  39. {
  40. if (e.KeyCode == Keys.Enter)
  41. {
  42. PageView1.Zoom = double.Parse(ZoomComBox.Text);
  43. }
  44. }
  45. }
  46. }