简单问题白送分了。
我有一个窗体,窗体内有根据需要排列了若干个TEXTBOX,我想咨询一下我用什么办法能将这些TEXTBOX的内容打印出来(打印机输出),最简单的办法是打印带个窗体,但我的窗体里还有其它按钮及控件,不想打印,本想把TEXTBOX放到一个PICTUREBOX上打印,但打印PICTUREBOX说上面没有内容,加了张白色图片又打不出来。请大家帮忙了。
[解决办法]
用printer对象
[解决办法]
定义一个text类,用一个循环,就可以把text类的内容全部打出来
[解决办法]
模块(1部分):
Private Type PALETTEENTRY
peRed As Byte
peGreen As Byte
peBlue As Byte
peFlags As Byte
End Type
Private Type LOGPALETTE
palVersion As Integer
palNumEntries As Integer
palPalEntry(255) As PALETTEENTRY ' Enough for 256 colors
End Type
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(7) As Byte
End Type
#If Win32 Then
Private Const RASTERCAPS As Long = 38
Private Const RC_PALETTE As Long = &H100
Private Const SIZEPALETTE As Long = 104
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function CreateCompatibleDC Lib "GDI32 " (ByVal hDC As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "GDI32 " (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function GetDeviceCaps Lib "GDI32 " (ByVal hDC As Long, ByVal iCapabilitiy As Long) As Long
Private Declare Function GetSystemPaletteEntries Lib "GDI32 " (ByVal hDC As Long, ByVal wStartIndex As Long, ByVal wNumEntries As Long, lpPaletteEntries As PALETTEENTRY) As Long
Private Declare Function CreatePalette Lib "GDI32 " (lpLogPalette As LOGPALETTE) As Long
Private Declare Function SelectObject Lib "GDI32 " (ByVal hDC As Long, ByVal hObject As Long) As Long
Private Declare Function BitBlt Lib "GDI32 " (ByVal hDCDest As Long, ByVal XDest As Long, ByVal YDest As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hDCSrc As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As Long) As Long
Private Declare Function DeleteDC Lib "GDI32 " (ByVal hDC As Long) As Long
Private Declare Function GetForegroundWindow Lib "USER32 " () As Long
Private Declare Function SelectPalette Lib "GDI32 " (ByVal hDC As Long, ByVal hPalette As Long, ByVal bForceBackground As Long) As Long
Private Declare Function RealizePalette Lib "GDI32 " (ByVal hDC As Long) As Long
Private Declare Function GetWindowDC Lib "USER32 " (ByVal hWnd As Long) As Long
Private Declare Function GetDC Lib "USER32 " (ByVal hWnd As Long) As Long
Private Declare Function GetWindowRect Lib "USER32 " (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function ReleaseDC Lib "USER32 " (ByVal hWnd As Long, ByVal hDC As Long) As Long
Private Declare Function GetDesktopWindow Lib "USER32 " () As Long
Private Type PicBmp
Size As Long
Type As Long
hBmp As Long
hPal As Long
Reserved As Long
End Type
Top