熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java核心技術 >> 正文

設計自己的printpreviewdialog

2022-06-13   來源: Java核心技術 

  源代碼
  
  Imports SystemDrawingprinting
  Imports Systemio
  Public Class previewcontrol
    Inherits SystemWindowsFormsForm
  
  #Region Windows 窗體設計器生成的代碼
  
    Public Sub New()
      MyBaseNew()
  
      該調用是 Windows 窗體設計器所必需的
      InitializeComponent()
  
      在 InitializeComponent() 調用之後添加任何初始化
  
    End Sub
  
    窗體重寫 dispose 以清理組件列表
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
      If disposing Then
        If Not (components Is Nothing) Then
          componentsDispose()
        End If
      End If
      MyBaseDispose(disposing)
    End Sub
  
    Windows 窗體設計器所必需的
    Private components As SystemComponentModelIContainer
  
    注意: 以下過程是 Windows 窗體設計器所必需的
    可以使用 Windows 窗體設計器修改此過程
    不要使用代碼編輯器修改它
    Friend WithEvents PrintPreviewControl As SystemWindowsFormsPrintPreviewControl
    Friend WithEvents printsetup As dbcbuttondbcbutton
    Private WithEvents pagesetup As dbcbuttondbcbutton
    Friend WithEvents Label As SystemWindowsFormsLabel
    Friend WithEvents Label As SystemWindowsFormsLabel
    Friend WithEvents Label As SystemWindowsFormsLabel
    Friend WithEvents openfile As dbcbuttondbcbutton
    Friend WithEvents setfont As dbcbuttondbcbutton
    Friend WithEvents printthis As dbcbuttondbcbutton
    Friend WithEvents pagecount As SystemWindowsFormsNumericUpDown
    Friend WithEvents pageroom As SystemWindowsFormsComboBox
    <SystemDiagnosticsDebuggerStepThrough()> Private Sub InitializeComponent()
      MePrintPreviewControl = New SystemWindowsFormsPrintPreviewControl
      Meprintsetup = New dbcbuttondbcbutton
      Mepagesetup = New dbcbuttondbcbutton
      Mepagecount = New SystemWindowsFormsNumericUpDown
      Mepageroom = New SystemWindowsFormsComboBox
      MeLabel = New SystemWindowsFormsLabel
      MeLabel = New SystemWindowsFormsLabel
      MeLabel = New SystemWindowsFormsLabel
      Meopenfile = New dbcbuttondbcbutton
      Mesetfont = New dbcbuttondbcbutton
      Meprintthis = New dbcbuttondbcbutton
      CType(Mepagecount SystemComponentModelISupportInitialize)BeginInit()
      MeSuspendLayout()
      
      PrintPreviewControl
      
      MePrintPreviewControlAnchor = CType((((SystemWindowsFormsAnchorStylesTop Or SystemWindowsFormsAnchorStylesBottom) _
            Or SystemWindowsFormsAnchorStylesLeft) _
            Or SystemWindowsFormsAnchorStylesRight) SystemWindowsFormsAnchorStyles)
      MePrintPreviewControlAutoZoom = False
      MePrintPreviewControlLocation = New SystemDrawingPoint( )
      MePrintPreviewControlName = PrintPreviewControl
      MePrintPreviewControlSize = New SystemDrawingSize( )
      MePrintPreviewControlTabIndex =
      MePrintPreviewControlZoom =
      
      printsetup
      
      MeprintsetupBackColor = SystemDrawingSystemColorsControl
      MeprintsetupButtonStyle = dbcbuttondbcbuttonStyleRectStyle
      MeprintsetupGrayColor = SystemDrawingColorBurlyWood
      MeprintsetupLightColor = SystemDrawingColorWhite
      MeprintsetupLocation = New SystemDrawingPoint( )
      Meprintsetupmytext = 打印設置
      MeprintsetupName = printsetup
      MeprintsetupSize = New SystemDrawingSize( )
      MeprintsetupTabIndex =
      
      pagesetup
      
      MepagesetupBackColor = SystemDrawingSystemColorsControl
      MepagesetupButtonStyle = dbcbuttondbcbuttonStyleRectStyle
      MepagesetupGrayColor = SystemDrawingColorBurlyWood
      MepagesetupLightColor = SystemDrawingColorWhite
      MepagesetupLocation = New SystemDrawingPoint( )
      Mepagesetupmytext = 頁面設置
      MepagesetupName = pagesetup
      MepagesetupSize = New SystemDrawingSize( )
      MepagesetupTabIndex =
      
      pagecount
      
      MepagecountLocation = New SystemDrawingPoint( )
      MepagecountMinimum = New Decimal(New Integer() { })
      MepagecountName = pagecount
      MepagecountSize = New SystemDrawingSize( )
      MepagecountTabIndex =
      MepagecountValue = New Decimal(New Integer() { })
      
      pageroom
      
      MepageroomItemsAddRange(New Object() {% % % %})
      MepageroomLocation = New SystemDrawingPoint( )
      MepageroomName = pageroom
      MepageroomSize = New SystemDrawingSize( )
      MepageroomTabIndex =
      MepageroomText = 縮放
      
      Label
      
      MeLabelLocation = New SystemDrawingPoint( )
      MeLabelName = Label
      MeLabelSize = New SystemDrawingSize( )
      MeLabelTabIndex =
      MeLabelText = 縮放
      MeLabelTextAlign = SystemDrawingContentAlignmentMiddleCenter
      
      Label
      
      MeLabelLocation = New SystemDrawingPoint( )
      MeLabelName = Label
      MeLabelSize = New SystemDrawingSize( )
      MeLabelTabIndex =
      MeLabelText =
      MeLabelTextAlign = SystemDrawingContentAlignmentMiddleCenter
      
      Label
      
      MeLabelLocation = New SystemDrawingPoint( )
      MeLabelName = Label
      MeLabelSize = New SystemDrawingSize( )
      MeLabelTabIndex =
      MeLabelText =
      MeLabelTextAlign = SystemDrawingContentAlignmentMiddleCenter
      
      openfile
      
      MeopenfileBackColor = SystemDrawingSystemColorsControl
      MeopenfileButtonStyle = dbcbuttondbcbuttonStyleRectStyle
      MeopenfileGrayColor = SystemDrawingColorBurlyWood
      MeopenfileLightColor = SystemDrawingColorWhite
      MeopenfileLocation = New SystemDrawingPoint( )
      Meopenfilemytext = 選擇文件
      MeopenfileName = openfile
      MeopenfileSize = New SystemDrawingSize( )
      MeopenfileTabIndex =
      
      setfont
      
      MesetfontBackColor = SystemDrawingSystemColorsControl
      MesetfontButtonStyle = dbcbuttondbcbuttonStyleRectStyle
      MesetfontGrayColor = SystemDrawingColorBurlyWood
      MesetfontLightColor = SystemDrawingColorWhite
      MesetfontLocation = New SystemDrawingPoint( )
      Mesetfontmytext = 設置字體
      MesetfontName = setfont
      MesetfontSize = New SystemDrawingSize(
From:http://tw.wingwit.com/Article/program/Java/hx/201311/27156.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.