Results 1 to 6 of 6

Thread: [RESOLVED] [2005] Alignment

  1. #1

    Thread Starter
    Hyperactive Member gooden's Avatar
    Join Date
    Dec 2006
    Location
    Portugal
    Posts
    274

    Resolved [RESOLVED] [2005] Alignment

    hi
    well my problem is the next......... i'm making a print in a paper my problem is that i whant to align to the right size of the paper all the items....

    like this....

    Code:
    artigo a                         49,00
    artigo b                       1150,00
    the code i have until the moment is :

    vb Code:
    1. Public Class Form1
    2.     Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
    3.  
    4.         Dim g As Graphics = e.Graphics
    5.  
    6.         Dim mensagem As String = "Ola"
    7.  
    8.         Dim FonteMensagem As New Font("Verdana", 10, System.Drawing.GraphicsUnit.Point)
    9.  
    10.         g.DrawString(mensagem, FonteMensagem, Brushes.Black, 0, 20)
    11.         g.DrawString(mensagem, FonteMensagem, Brushes.Black, 0, 40)
    12.  
    13.     End Sub
    14.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    15.         PrintDocument1.Print()
    16.         'PrintPreviewDialog1.ShowDialog()
    17.  
    18.     End Sub
    19. End Class


    The Future Is Always The Way To Live The Life

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Alignment

    DrawString is overloaded so you can specify all sorts of different things about the string being drawn, including the horizontal alignment. Look up the DrawString method in the MSDN library and see what different parameters you can pass.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member gooden's Avatar
    Join Date
    Dec 2006
    Location
    Portugal
    Posts
    274

    Re: [2005] Alignment

    I cant find


    The Future Is Always The Way To Live The Life

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Alignment

    You can't open MSDN and searh for drawstring?

    http://search.msdn.microsoft.com/sea...=00&lang=en-us

    That page includes links to basically all the topics for the different overloads of the DrawString method. It also includes a link to the topic that lists all the overloads. You can follow each link and read about that method. If you do that you will find the answer you're looking for.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Hyperactive Member gooden's Avatar
    Join Date
    Dec 2006
    Location
    Portugal
    Posts
    274

    Re: [2005] Alignment

    I DID IT

    ty tytytytyty


    The Future Is Always The Way To Live The Life

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] [2005] Alignment

    Hopefully you agree with me that doing it yourself with a point in the right direction is more satisfying and ultimately more beneficial than having the solution handed to you on a plate. Now that you've seen how you can solve this problem using the documentation you should hopefully be able to solve, at least partially, more of your own issues. That can only be a good thing.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width