IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Forms Discussion :

[VB.NET]Comment Imprimer une form [FAQ]


Sujet :

Windows Forms

  1. #1
    Candidat au Club
    Inscrit en
    Février 2003
    Messages
    1
    Détails du profil
    Informations forums :
    Inscription : Février 2003
    Messages : 1
    Points : 2
    Points
    2
    Par défaut [VB.NET]Comment Imprimer une form
    Salut à tous les accros de Visual.net
    Je cherche comment imprimer une form sur VB.net.
    Sur visual Basic 6.0 il suffisait de taper printform.
    J'ai essayé de trouver sur VB.net, mais rien à faire.
    Il existe un compenent à la vente, en existe-t-il un gratuit ou quelqu'un peut-il me guider pour imprimer une feuille compléte ?

    Je suis un débutant en programmation et j'apprend dans des livres.

    J'espére avoir une réponse pour pouvoir continuer d'avancer.

    Merci à ceuli ou ceux qui me répondront.

    Bernard
    bernard

  2. #2
    Membre averti

    Homme Profil pro
    Inscrit en
    Mars 2002
    Messages
    0
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 0
    Points : 314
    Points
    314
    Par défaut
    tu as un composant qui s'apelle PrintForm .NET Printing Component qui a une version gratuite d'essai qui peut faire ca (trouvable ici)

    De plus si tu avais regardé à "printform" dans la doc fournie avec .NET tu aurais vu ceci :
    PrintForm No equivalent. For more information, see Printing Changes in Visual Basic .NET.
    autrement dit :
    il n'y a pas d'equivalent de PrintForm en VB.NET
    De plus il te donnent les conseils suivants juste uu peu plus loin (un lien à cliquer) (trop de texte, je ne traduirais pas)
    Other Printing Changes
    In Visual Basic 6.0, the PrintForm method of a form could be used to send an image of the form to a printer. The PrintForm method is no longer supported in Visual Basic .NET. The results of the PrintForm method varied greatly depending on the screen resolution and the resolution of the printer; it was not the recommended method of printing. If you need to duplicate the functionality of the PrintForm method, you can automate the screen capture capabilities of a third-party graphics tool to capture and print an image of a form.

    In Visual Basic 6.0, implementing print preview was only possible through third-party controls. In Visual Basic .NET, the PrintPreviewDialog control can be used to provide a standard Windows Print Preview dialog box. For more information, see Introduction to the Windows Forms PrintPreviewDialog Control.

    In Visual Basic 6.0, no user interface for page setup was provided. In Visual Basic .NET, the PageSetupDialog control can be used to provide a standard Windows Page Setup dialog box. For more information, see Introduction to the Windows Forms PageSetupDialog Component.

    In Visual Basic 6.0, printing text from a file required a considerable amount of code. In Visual Basic .NET, the StreamReader class can be used to pass the contents of a text file directly to a PrintDocument component. For details, see PrintDocument.Print Method.

  3. #3
    Membre du Club
    Inscrit en
    Novembre 2002
    Messages
    35
    Détails du profil
    Informations personnelles :
    Âge : 50

    Informations forums :
    Inscription : Novembre 2002
    Messages : 35
    Points : 44
    Points
    44
    Par défaut
    Bonjour,


    Voici un ex :

    http://msdn.microsoft.com/msdnmag/issues/03/02/printinginNET/TOC.ASP
    La simplicité est la sophistication suprême.

  4. #4
    Membre averti
    Avatar de Rami
    Profil pro
    Inscrit en
    Juillet 2002
    Messages
    177
    Détails du profil
    Informations personnelles :
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Juillet 2002
    Messages : 177
    Points : 330
    Points
    330
    Par défaut
    j'ai eu besoin de faire une impression d'une partie de l'etat de mon interface hier, voila ce que j'ai dégoté:

    une solution pour imprimer un form:
    http://msdn.microsoft.com/library/de...intingForm.asp
    Note1: utilisation de l'API (gdi32.dll) et donc perte d'un portage eventuel sur d'autres plateformes.
    Note2:
    dans la fonction :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Private Sub CaptureScreen()
    remplacez
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Dim mygraphics As Graphics = Me.CreateGraphics()
    par
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Dim mygraphics As Graphics = Me.MonControl.CreateGraphics()
    pour imprimer un controle particulier (treeview, listeview, ...)
    Ex Moderateur .Net

  5. #5
    Membre confirmé

    Profil pro
    Inscrit en
    Juillet 2009
    Messages
    140
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2009
    Messages : 140
    Points : 623
    Points
    623
    Par défaut
    Les liens précédents ne fonctionnent plus.

    Pour imprimer une fenêtre, on peut utiliser Visual Basic Power Packs 3.0 :
    http://msdn.microsoft.com/en-us/vbasic/bb735936.aspx

    Sinon, pour dessiner une fenêtre dans une image, il y a la fonction DrawToBitmap qui est disponible pour n'importe quel contrôle.
    Par-delà nos conceptions du bien et du mal se trouve une prairie. Je te rencontrerai là-bas.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Comment imprimer une Form (page) complète en vb6
    Par ryukat666 dans le forum VB 6 et antérieur
    Réponses: 15
    Dernier message: 24/08/2015, 14h58
  2. [FastReport] Comment imprimer une Form ?
    Par logiciel_const dans le forum Composants VCL
    Réponses: 6
    Dernier message: 30/07/2009, 22h17
  3. [VB.NET] Comment lancer une application externe dans ma Form
    Par afdmats dans le forum Windows Forms
    Réponses: 1
    Dernier message: 03/10/2006, 15h27
  4. [VB.NET] Comment associer une Ombre à une Form?
    Par jazz matazz dans le forum Windows Forms
    Réponses: 6
    Dernier message: 28/02/2006, 14h00
  5. [VB.NET] Comment déplacer une Form d'une appli. exterieure?
    Par jazz matazz dans le forum Windows Forms
    Réponses: 8
    Dernier message: 03/02/2006, 01h24

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo