Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MSChart-Conrtol VB6 - Drucken

Empfohlene Antworten

Veröffentlicht

Hi,

ich habe hier ein MSChartControl, das einfach nur eine Jahresübersicht von Zahlen hat (12 Reihen, eine Spalte)

wenn ich wie im VB6 Buch von Michael Kofler beschrieben das Ding drucken will, dann fehlt links und recht ein wenig, so das die Y-Achsenbeschriftung (also 100,200,300,400..) sowohl links auch rechts nicht komplett sind. Das MSChart-Control selbst unterstützt das drucken ja nicht, so dass der Umweg über das Clipboard und das Printer-Objekt gegangen werden muss:

Clipboard.clear

Dim border

Me.MSChart2.EditCopy

Set Picture.Picture = Clipboard.GetData(vbCFMetafile)

Printer.ColorMode = 1

Printer.Orientation = vbPRORLandscape

border = Printer.ScaleWidth / 20

Printer.PaintPicture Me.Picture1.Picture, border, _

border,Printer.ScaleWidth - 2 * border, _

Printer.ScaleHeight - 2 * border

Printer.EndDoc

Testweise habe ich mit den Border-Werten rumgespielt und auch ein anderes Picture-Control (von Protoview) verwendet. Dort war das gleiche Problem.

Nun, mein Leben hängt vom Feature "Chart Drucken" nicht ab, doch ich hätts halt gerne eingebaut.

Any Hints?

thanx

Buell

Lösung gefunden :)

mit dem Imagecontrol und andere Width-Werte gehts nun optimal:

Me.MSChart2.EditCopy

Me.Image1.Picture = Clipboard.GetData(vbCFMetafile)

If Me.Option1.Value = True Then

Printer.Orientation = vbPRORLandscape

Else

Printer.Orientation = vbPRORPortrait

End If

Printer.ScaleMode = vbTwips

co = Printer.ScaleWidth / Me.Image1.Width

y = Printer.CurrentY

Printer.PaintPicture Me.Image1.Picture, 0, y, Me.Image1.Width * co, Me.Image1.Height * co

Printer.EndDoc

ciao

Buell

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.