Accueil > > > MSFLEXGRID L'IMPRESSION !
MSFLEXGRID L'IMPRESSION !
Information sur la source
Description
Juste une procedure d'impression de l'objet MSflexgrid, pour aider d'autre personne ! 2 Objets: 1 bouton=command1 et une Msflexgrid=msf1
Source
- Private Sub Command1_Click()
- Call imprime(msf1)
- End Sub
-
- Private Sub Form_Load()
- 'pour adapter a la resolution
- Dim X, Y As Integer
- X = Screen.Width / Screen.TwipsPerPixelX
- Y = Screen.Height / Screen.TwipsPerPixelY
- rx = X / 800
- ry = Y / 600
- '*************
- msf1.Cols = 10
- msf1.Font.Size = 10
-
- msf1.FixedCols = 0
- msf1.ColWidth(0) = 2800 * rx ' client
- msf1.ColWidth(1) = 500 * rx 'logo
- msf1.ColWidth(2) = 1000 * rx 'ville
- msf1.ColWidth(3) = 2000 * rx 'materiel
- msf1.ColWidth(4) = 1000 * rx 'situation
- msf1.ColWidth(5) = 1000 * rx 'date appel
- msf1.ColWidth(6) = 0 ' la clef n'apparait pas dans le tableau
- msf1.ColWidth(7) = 1000 * rx 'intervention
- msf1.ColWidth(8) = 1000 * rx 'technicien
- msf1.ColWidth(9) = 1000 * rx 'pret
-
- msf1.TextMatrix(0, 0) = "Clients"
- msf1.TextMatrix(0, 1) = "Logo"
- msf1.TextMatrix(0, 2) = "Ville"
- msf1.TextMatrix(0, 3) = "Materiel"
- msf1.TextMatrix(0, 4) = "Situation"
- msf1.TextMatrix(0, 5) = "Date appel"
- msf1.TextMatrix(0, 6) = "clef"
- msf1.TextMatrix(0, 7) = "Date intervention"
- msf1.TextMatrix(0, 8) = "Technicien"
- msf1.TextMatrix(0, 9) = "Pret"
- msf1.Rows = 12
- For a% = 1 To 10
- msf1.TextMatrix(a%, Int((8 * Rnd) + 1)) = "N'importe quoi"
- Next a%
-
- End Sub
- Sub imprime(grille As MSFlexGrid)
- Printer.ScaleMode = 6
- offset% = Printer.CurrentY
- Printer.FontName = "ARIAL"
- Printer.FontSize = 8.3
- Printer.FontBold = False
- 'pour adapter a la resolution
- Dim X, Y As Integer
-
- X = Screen.Width / Screen.TwipsPerPixelX
- Y = Screen.Height / Screen.TwipsPerPixelY
- rx = X / 800
- ry = Y / 600
- '*******
- hh% = grille.CellTop / ry
- Y1% = offset%
- For a% = 0 To grille.Rows - 1
- grille.Row = a% 'ligne active
- Y1% = Y1% + ((grille.CellHeight / ry) / 56.7)
- If Y1% > 270 Then Printer.NewPage: Y1% = 10
-
- Y2% = Y1% + ((grille.CellHeight / ry) / 56.7)
- For b% = 0 To grille.Cols - 1
- grille.Col = b% 'colonne ative
- X1% = (grille.CellLeft / rx) / 56.7
- X2% = X1% + ((grille.CellWidth / rx) / 56.7)
- coul = grille.CellBackColor
- If coul = 0 Then coul = RGB(255, 255, 255)
- Printer.FillStyle = 0 'rectangle plein
- Printer.FillColor = coul
-
- Printer.Line (X1%, Y1%)-(X2%, Y2%), , B
- Printer.CurrentX = X1% + 0.5
- Printer.CurrentY = Y1%
- t$ = grille.Text
- tt$ = ""
- If grille.CellWidth > 0 Then
- For ac% = 1 To Len(t$)
- tt$ = Left(t$, ac%)
- wc% = Printer.TextWidth(tt$) ' twips
- If X1% + wc% > X2% - 2 Then Exit For
- Next ac%
- tb$ = Left(tt$, ac%)
- For i% = 1 To Len(tb$)
- ie% = InStr(tb$, Chr$(13) + Chr$(10))
- If ie% > 0 Then
- tbb$ = Left(tb$, ie% - 1)
- tb$ = Mid(tb$, ie% + 2)
- Printer.CurrentX = X1% + 0.5
- Printer.Print tbb$
- i% = ie% + 2
- Else
- Printer.CurrentX = X1% + 0.5
- Printer.Print tb$
- Exit For
- End If
- Next i%
-
- End If
- Next b%
- Next a%
- Printer.EndDoc
- End Sub
Private Sub Command1_Click()
Call imprime(msf1)
End Sub
Private Sub Form_Load()
'pour adapter a la resolution
Dim X, Y As Integer
X = Screen.Width / Screen.TwipsPerPixelX
Y = Screen.Height / Screen.TwipsPerPixelY
rx = X / 800
ry = Y / 600
'*************
msf1.Cols = 10
msf1.Font.Size = 10
msf1.FixedCols = 0
msf1.ColWidth(0) = 2800 * rx ' client
msf1.ColWidth(1) = 500 * rx 'logo
msf1.ColWidth(2) = 1000 * rx 'ville
msf1.ColWidth(3) = 2000 * rx 'materiel
msf1.ColWidth(4) = 1000 * rx 'situation
msf1.ColWidth(5) = 1000 * rx 'date appel
msf1.ColWidth(6) = 0 ' la clef n'apparait pas dans le tableau
msf1.ColWidth(7) = 1000 * rx 'intervention
msf1.ColWidth(8) = 1000 * rx 'technicien
msf1.ColWidth(9) = 1000 * rx 'pret
msf1.TextMatrix(0, 0) = "Clients"
msf1.TextMatrix(0, 1) = "Logo"
msf1.TextMatrix(0, 2) = "Ville"
msf1.TextMatrix(0, 3) = "Materiel"
msf1.TextMatrix(0, 4) = "Situation"
msf1.TextMatrix(0, 5) = "Date appel"
msf1.TextMatrix(0, 6) = "clef"
msf1.TextMatrix(0, 7) = "Date intervention"
msf1.TextMatrix(0, 8) = "Technicien"
msf1.TextMatrix(0, 9) = "Pret"
msf1.Rows = 12
For a% = 1 To 10
msf1.TextMatrix(a%, Int((8 * Rnd) + 1)) = "N'importe quoi"
Next a%
End Sub
Sub imprime(grille As MSFlexGrid)
Printer.ScaleMode = 6
offset% = Printer.CurrentY
Printer.FontName = "ARIAL"
Printer.FontSize = 8.3
Printer.FontBold = False
'pour adapter a la resolution
Dim X, Y As Integer
X = Screen.Width / Screen.TwipsPerPixelX
Y = Screen.Height / Screen.TwipsPerPixelY
rx = X / 800
ry = Y / 600
'*******
hh% = grille.CellTop / ry
Y1% = offset%
For a% = 0 To grille.Rows - 1
grille.Row = a% 'ligne active
Y1% = Y1% + ((grille.CellHeight / ry) / 56.7)
If Y1% > 270 Then Printer.NewPage: Y1% = 10
Y2% = Y1% + ((grille.CellHeight / ry) / 56.7)
For b% = 0 To grille.Cols - 1
grille.Col = b% 'colonne ative
X1% = (grille.CellLeft / rx) / 56.7
X2% = X1% + ((grille.CellWidth / rx) / 56.7)
coul = grille.CellBackColor
If coul = 0 Then coul = RGB(255, 255, 255)
Printer.FillStyle = 0 'rectangle plein
Printer.FillColor = coul
Printer.Line (X1%, Y1%)-(X2%, Y2%), , B
Printer.CurrentX = X1% + 0.5
Printer.CurrentY = Y1%
t$ = grille.Text
tt$ = ""
If grille.CellWidth > 0 Then
For ac% = 1 To Len(t$)
tt$ = Left(t$, ac%)
wc% = Printer.TextWidth(tt$) ' twips
If X1% + wc% > X2% - 2 Then Exit For
Next ac%
tb$ = Left(tt$, ac%)
For i% = 1 To Len(tb$)
ie% = InStr(tb$, Chr$(13) + Chr$(10))
If ie% > 0 Then
tbb$ = Left(tb$, ie% - 1)
tb$ = Mid(tb$, ie% + 2)
Printer.CurrentX = X1% + 0.5
Printer.Print tbb$
i% = ie% + 2
Else
Printer.CurrentX = X1% + 0.5
Printer.Print tb$
Exit For
End If
Next i%
End If
Next b%
Next a%
Printer.EndDoc
End Sub
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Impression d'un controle [ par MorpionMx ]
Bonjour a tous, J'ai dans un Panel 2 Control persos. Et j'aimerais imprimer ces 2 Control l'un a coté de l'autre, ou alors ce qu'il y a dans le
Impression avec VB.NET [ par ava0275 ]
Bonjour ,Voici le topo ce que je veux faire:je fais une appli dans laquelle l utilisateur place des textbox dans un panel pendant l execution.Je
comment imprimer une MSFlexgrid sur plusieur page [ par miklklkl ]
Miklkl mailto:miklklkl@hotmail.comcomment imprimer une MSFlexgrid sur plusieur pageavec 'printer'merci d'avance</
Affichage ou pas de la boite de dialogue config d'impression [ par feaskaertes ]
Bonjour ;)Un petit souci avec le showprinter : j'ai un commondialog (Dialog) sur une feuille mère (Reseau_PC) et je l'appelle sur une feuille fille av
problème d'impression de formulaire [ par ppppp ]
Bonjour à tous.J'ai créer différentes calculettes financières durant mon stage. Voila mon problème:Je voudrais imprimer le formulaire avec toutes les
problème d'impression [ par gros71 ]
il me semble avoir mal expliqué mon problème dans un précédent message.je voudrais pouvoir imprimer une feuille de classeur exel a partir d'une form q
Impression.... [ par allfab ]
Bonjour à tous,Je souhaite imprimer...mais je n'y arrive pas...c'est pourquoi je fais appel à vous.En fait, dans une form, j'ai une picturebox contena
NET: Comment imprimer le nom et indice d'un control [ par scubaduba ]
Salut; J'ai voulu imprimer le nom d'un control (comme si c'est un textbox --> TextBox, pas le nom que j'ai donne) avec son indice (c'est preferabl
impression en fonction de la saisie sur excel [ par flamalex ]
je suis sur excel et utilise le VB de excel.Comment Imprimer ?, uniquement ce qui a été rempli sur une feuil2 Excel jusqu
imprimer à partir d'un code [ par dnpauline ]
salut à tous!j'aimerais personnaliser une impression à partir d'un code. c'est à dire le click sur le bouton 'impression' vous permet de définir le fo
|
Derniers Blogs
ASYNC/AWAIT: COMPRENDRE COMMENT CA MARCHEASYNC/AWAIT: COMPRENDRE COMMENT CA MARCHE par fathi
Tout le monde est unanime pour dire que la programmation multi-thread et asynchrone est en train de devenir un sujet incontournable. Beaucoup de choses sont arrivées avec le framework 4 pour le code parallèle (TPL, PLinq,.) et bientôt, on va avoir l...
Cliquez pour lire la suite de l'article par fathi PAS D'INTELLITRACE SUR MON SITE WEB DANS IIS !PAS D'INTELLITRACE SUR MON SITE WEB DANS IIS ! par Etienne Margraff
J'ai récemment eu un problème pour obtenir l'intelliTrace sur un site web dans IIS. Il n'y avait pas de message d'erreur, rien dans le journal d'évènement Windows, et après 3 appels à une voyante, 2 visites chez un marabou, j'ai failli me résign...
Cliquez pour lire la suite de l'article par Etienne Margraff OFFICE 365 - SHAREPOINT ONLINE, QUELQUES LIMITATIONSOFFICE 365 - SHAREPOINT ONLINE, QUELQUES LIMITATIONS par junarnoalg
De nombreuses entreprises font le choix de SharePoint Online, service fourni au travers de l'offre de Microsoft Office 365. S'il est vrai que ce choix apporte un grand nombre d'avantages; rapidité de mise en œuvre, disponibilité, large couvertu...
Cliquez pour lire la suite de l'article par junarnoalg PRéSENTATION DES API REST DE WINDOWS AZURE : LISTER LES COMPTES DE STORAGEPRéSENTATION DES API REST DE WINDOWS AZURE : LISTER LES COMPTES DE STORAGE par richardc
http://www.c2idotnet.com/articles/presentation-des-api-rest-de-windows-azure-lister-les-comptes-de-storage
Désolé pour "toto", mais c2i existait avant blogs.developpeur.org et c'est mon site "officiel" ;-) ...
Cliquez pour lire la suite de l'article par richardc
Logiciels
DocTranslate (V3.1.0.0)DOCTRANSLATE (V3.1.0.0)DocTranslate est un traducteur de document Microsoft Word, PowerPoint et Excel. Il permet d'autom... Cliquez pour télécharger DocTranslate Tribler (2012)TRIBLER (2012)Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des... Cliquez pour télécharger Tribler OneSwarm (2012)ONESWARM (2012)Le peer-to-peer qui protège votre vie privée, c'est OneSwarm.
Ce logiciel de peer-to-peer crypté... Cliquez pour télécharger OneSwarm PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System
|