asgarth
Messages postés6Date d'inscriptionmercredi 14 mai 2003StatutMembreDernière intervention 1 décembre 2003
-
7 juin 2003 à 00:02
cs_rene38
Messages postés1858Date d'inscriptionsamedi 29 juin 2002StatutMembreDernière intervention17 octobre 2013
-
7 juin 2003 à 11:15
Bonjour
Je veux imprimer un fichier text en noir avec certains mots en rouge!
quelles propriétés utiliser avec l'objet Printer ou Font?
qqch dans le genre :
Printer.FontColor=VBRed
Faaut-il passer par le mode graphique?
nhervagault
Messages postés6063Date d'inscriptiondimanche 13 avril 2003StatutMembreDernière intervention15 juillet 201137 7 juin 2003 à 02:29
un ptit bout de programme à adapter à ta situation gere pas les couleurs mais d'autres controles mais pas tous.
Il faut avoir des conventions de nommage ..
Private Sub print_control(printer As printer, ByVal control As Object)
If (Left(control.Name, 4) = "Line") Then
printer.Line (control.X1, control.Y1)-(control.X2, control.Y2)
ElseIf (Left(control.Name, 5) = "Image") Then
'printer.Line (control.X1, control.Y1)-(control.X2, control.Y2)
Dim stdPict As New StdPicture
Set stdPict = LoadPicture(App.Path & "\myphoto.jpg")
printer.PaintPicture stdPict, control.Left, control.Top, control.Width, control.Height
Else
Select Case control.Alignment
Case vbCenter
printer.CurrentX = control.Left + control.Width / 2 - printer.TextWidth(control.Caption) \ 2
Case vbLeftJustify
printer.CurrentX = control.Left
Case vbRightJustify
printer.CurrentX = control.Left + control.Width - printer.TextWidth(control.Caption)
End Select