掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
DrawTextでプリンターに出力するには? (ID:101747)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
K.J.K.さん ありがとうございます。 hdcを確認しようと思い、試しに、 ---------------------------------------------- Option Explicit Private Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As Rect, ByVal wFormat As Long) As Long Private Type Rect Left As Long Top As Long Right As Long Bottom As Long End Type Private Sub Form_Load() Dim Ret As Integer Dim Rect As Rect Dim Flag As Integer Dim Phdc Phdc = Printer.hdc Flag = &H0 Rect.Left = 100 Rect.Top = 100 Rect.Right = 300 Rect.Bottom = 200 Ret = DrawText(Phdc, "abc1", Len("abc1"), Rect, Flag) Print Printer.hdc Printer.Print " " Rect.Left = 100 Rect.Top = 200 Rect.Right = 300 Rect.Bottom = 300 Ret = DrawText(Phdc, "abc2", Len("abc2"), Rect, Flag) Print Printer.hdc Printer.EndDoc End Sub ---------------------------------------------- としてみたところ、フォームには、同じ値のPrinter.hdcが2つ表示されましたが、プリンターからは、"abc2"の文字しか出力されませんでした。 hdcを取得するだけではだめなのでしょうか。
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.