Click here to Skip to main content
15,850,547 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: printing form Pin
asha_s16-Apr-08 7:52
asha_s16-Apr-08 7:52 
GeneralRe: printing form Pin
Steven J Jowett16-Apr-08 5:08
Steven J Jowett16-Apr-08 5:08 
GeneralRe: printing form Pin
asha_s16-Apr-08 7:51
asha_s16-Apr-08 7:51 
GeneralRe: printing form Pin
Steven J Jowett16-Apr-08 13:16
Steven J Jowett16-Apr-08 13:16 
QuestionRe: printing form Pin
asha_s19-Apr-08 9:15
asha_s19-Apr-08 9:15 
GeneralRe: printing form Pin
Steven J Jowett20-Apr-08 12:12
Steven J Jowett20-Apr-08 12:12 
GeneralRe: printing form Pin
asha_s21-Apr-08 1:39
asha_s21-Apr-08 1:39 
GeneralPrinting Problem² [modified] Pin
Zaegra16-Apr-08 1:14
Zaegra16-Apr-08 1:14 
Hey,
I have the following code:
 e.Graphics.DrawImage(Logo, 50, 50)<br />
<br />
        Dim PrintFont As New Font(Me.Font, FontStyle.Regular)<br />
        Dim PrintFontBold As New Font(Me.Font, FontStyle.Bold)<br />
<br />
        Dim strFormat As New StringFormat<br />
<br />
        Dim rectDraw As New RectangleF( _<br />
          e.MarginBounds.Left, e.MarginBounds.Top, _<br />
          e.MarginBounds.Width, e.MarginBounds.Height)<br />
<br />
        Dim sizeMeasure As New SizeF(e.MarginBounds.Width, _<br />
          e.MarginBounds.Height - PrintFont.GetHeight(e.Graphics))<br />
<br />
        Dim FontHgt As Single = PrintFont.GetHeight(e.Graphics)<br />
        Dim g As System.Drawing.Graphics = Me.CreateGraphics<br />
<br />
        strFormat.Trimming = StringTrimming.None<br />
<br />
        Dim strAdress As String = "Adres: " & CompAdress & ", " & CompPostCode & ", " & CompCity<br />
        Dim strPhoneFax As String = "Tel: " & CompPhoneNo & ", Fax: " & CompFaxNo<br />
        Dim strWebEmail As String = "Internet: " & CompWebsite & ", E-mail: " & CompEmail<br />
        Dim strBankAcc As String = "Bank: " & CompBankName & ", Bankrekeningnummer: " & CompAccNo<br />
        Dim strGiro As String = "Gironummer: " & CompGiroNo<br />
        Dim strBTWNo As String = "BTW Nummer: " & CompBTWNo<br />
<br />
<br />
        Dim StrAdrSize As SizeF = e.Graphics.MeasureString(strAdress, PrintFont)<br />
        Dim StrPhoneFaxSize As SizeF = e.Graphics.MeasureString(strPhoneFax, PrintFont)<br />
        Dim StrWebEmailSize As SizeF = e.Graphics.MeasureString(strWebEmail, PrintFont)<br />
        Dim StrBankAccSize As SizeF = e.Graphics.MeasureString(strBankAcc, PrintFont)<br />
        Dim StrGiroSize As SizeF = e.Graphics.MeasureString(strGiro, PrintFont)<br />
        Dim StrBTWNoSize As SizeF = e.Graphics.MeasureString(strBTWNo, PrintFont)<br />
<br />
        e.Graphics.DrawString(strAdress, PrintFont, Brushes.Black, rectDraw.Width - StrAdrSize.Width, 50)<br />
        e.Graphics.DrawString(strPhoneFax, PrintFont, Brushes.Black, rectDraw.Width - StrPhoneFaxSize.Width, 50 + FontHgt)<br />
        e.Graphics.DrawString(strWebEmail, PrintFont, Brushes.Black, rectDraw.Width - StrWebEmailSize.Width, 50 + FontHgt * 2)<br />
        e.Graphics.DrawString(strBankAcc, PrintFont, Brushes.Black, rectDraw.Width - StrBankAccSize.Width, 50 + FontHgt * 3)<br />
        e.Graphics.DrawString(strGiro, PrintFont, Brushes.Black, rectDraw.Width - StrGiroSize.Width, 50 + FontHgt * 4)<br />
        e.Graphics.DrawString(strGiro, PrintFont, Brushes.Black, rectDraw.Width - StrBTWNoSize.Width, 50 + FontHgt * 5)<br />
        e.HasMorePages = False


When I print this i get the following result:
Link>

As you can see the sentences are not lined up properly. What am I doing wrong?
I would like to have all the sentences at a straight line.

Thanks in advance, Big Grin | :-D
Zaegra

modified on Wednesday, April 16, 2008 6:24 AM

GeneralRe: Printing Problem² Pin
Chinners16-Apr-08 1:55
Chinners16-Apr-08 1:55 
GeneralRe: Printing Problem² Pin
Zaegra16-Apr-08 2:37
Zaegra16-Apr-08 2:37 
QuestionCapture screen as movie Pin
Mohammad Al Hoss15-Apr-08 23:29
Mohammad Al Hoss15-Apr-08 23:29 
GeneralRe: Capture screen as movie Pin
Dave Kreskowiak16-Apr-08 5:04
mveDave Kreskowiak16-Apr-08 5:04 
QuestionHow manage scroll position in listview without using API function. Pin
Coban_15-Apr-08 22:43
Coban_15-Apr-08 22:43 
AnswerRe: How manage scroll position in listview without using API function. Pin
Dave Kreskowiak16-Apr-08 4:59
mveDave Kreskowiak16-Apr-08 4:59 
GeneralRe: How manage scroll position in listview without using API function. Pin
Coban_16-Apr-08 5:42
Coban_16-Apr-08 5:42 
GeneralRe: How manage scroll position in listview without using API function. Pin
Dave Kreskowiak16-Apr-08 13:23
mveDave Kreskowiak16-Apr-08 13:23 
GeneralRe: How manage scroll position in listview without using API function. Pin
Coban_16-Apr-08 21:11
Coban_16-Apr-08 21:11 
GeneralRe: How manage scroll position in listview without using API function. Pin
Dave Kreskowiak17-Apr-08 3:47
mveDave Kreskowiak17-Apr-08 3:47 
GeneralRe: How manage scroll position in listview without using API function. Pin
Coban_17-Apr-08 5:07
Coban_17-Apr-08 5:07 
Questionis any program that make exe file that work on computers without .netframework Pin
en.Mahdi15-Apr-08 22:02
en.Mahdi15-Apr-08 22:02 
GeneralRe: is any program that make exe file that work on computers without .netframework Pin
Christian Graus15-Apr-08 22:03
protectorChristian Graus15-Apr-08 22:03 
GeneralRe: is any program that make exe file that work on computers without .netframework Pin
N a v a n e e t h15-Apr-08 22:14
N a v a n e e t h15-Apr-08 22:14 
AnswerRe: is any program that make exe file that work on computers without .netframework Pin
en.Mahdi16-Apr-08 2:43
en.Mahdi16-Apr-08 2:43 
GeneralRe: is any program that make exe file that work on computers without .netframework Pin
Dave Kreskowiak16-Apr-08 4:55
mveDave Kreskowiak16-Apr-08 4:55 
GeneralRe: is any program that make exe file that work on computers without .netframework Pin
~V~16-Apr-08 2:32
~V~16-Apr-08 2:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.