Platforms to show: All Mac Windows Linux Cross-Platform
/Win/HTMLViewer Windows/More HTMLViewer Printing
Required plugins for this example: MBS Win Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Win/HTMLViewer Windows/More HTMLViewer Printing
This example is the version from Tue, 6th Jul 2015.
Project "More HTMLViewer Printing.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
if not TargetWin32 then
MsgBox "This example is for Windows only."
end if
End EventHandler
End Class
Class Window1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
dim p as new Picture(HTMLViewer1.Width, HTMLViewer1.Height, 32)
dim g as Graphics = p.Graphics
dim h as integer = g.Handle(g.HandleTypeHDC)
if h = 0 then
MsgBox "no handle?"
Return
end if
dim ph as ptr = ptr(h)
dim b as Boolean = HTMLViewer1.IEDrawToHDCMBS(ph,"")
if b then
dim pw as new PicWindow
pw.Backdrop = p
pw.show
end if
End EventHandler
End Control
Control HTMLViewer1 Inherits HTMLViewer
ControlInstance HTMLViewer1 Inherits HTMLViewer
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action()
dim g as Graphics = OpenPrinter
if g = nil then
MsgBox "Failed to open printer"
Return
end if
dim h as integer = g.Handle(g.HandleTypeHDC)
if h = 0 then
MsgBox "no handle?"
Return
end if
dim ph as ptr = ptr(h)
dim PrinterName as string = WindowsPrinterMBS.GetDefaultPrinter
dim b as Boolean = HTMLViewer1.IEDrawToHDCMBS(ph, PrinterName)
End EventHandler
End Control
EventHandler Sub Open()
HTMLViewer1.LoadURL "http://www.monkeybreadsoftware.de/"
End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Class PicWindow Inherits Window
End Class
End Project
See also:
- /Win/HTMLViewer Windows/DebugBar
- /Win/HTMLViewer Windows/HTMLViewer Extensions
- /Win/HTMLViewer Windows/HTMLViewer HTML Text and Image
- /Win/HTMLViewer Windows/HTMLViewer Image
- /Win/HTMLViewer Windows/HTMLViewer Post and Headers
- /Win/HTMLViewer Windows/IE Properties
- /Win/HTMLViewer Windows/Run JavaScript Function
- /Win/HTMLViewer Windows/WebKit - Chromium/WebPlugins
- /Win/HTMLViewer Windows/WebKit - Chromium/Windows WebKit Cookies
- /Win/HTMLViewer Windows/Zoom HMTLViewer
The items on this page are in the following plugins: MBS Win Plugin.