Click here to Skip to main content
15,893,588 members
Home / Discussions / C#
   

C#

 
GeneralTAPI3 Telephony with Playback Pin
Harihara Subramanian25-Sep-02 20:31
Harihara Subramanian25-Sep-02 20:31 
GeneralRe: TAPI3 Telephony with Playback Pin
Ray Cassick26-Sep-02 3:53
Ray Cassick26-Sep-02 3:53 
GeneralTree View Pin
Mazdak24-Sep-02 23:34
Mazdak24-Sep-02 23:34 
GeneralRe: Tree View Pin
leppie25-Sep-02 5:36
leppie25-Sep-02 5:36 
GeneralRe: Tree View Pin
Mazdak25-Sep-02 6:51
Mazdak25-Sep-02 6:51 
GeneralRe: Tree View Pin
leppie25-Sep-02 7:35
leppie25-Sep-02 7:35 
GeneralRe: Tree View Pin
Wjousts25-Sep-02 8:29
Wjousts25-Sep-02 8:29 
QuestionOfficeXP visual style??? Pin
ZZZr24-Sep-02 22:21
sussZZZr24-Sep-02 22:21 
AnswerRe: OfficeXP visual style??? Pin
Paul Watson24-Sep-02 23:22
sitebuilderPaul Watson24-Sep-02 23:22 
GeneralRe: OfficeXP visual style??? Pin
Maciej Pirog25-Sep-02 8:44
Maciej Pirog25-Sep-02 8:44 
GeneralRe: OfficeXP visual style??? Pin
Paul Watson25-Sep-02 8:53
sitebuilderPaul Watson25-Sep-02 8:53 
GeneralRe: OfficeXP visual style??? Pin
Maciej Pirog25-Sep-02 9:22
Maciej Pirog25-Sep-02 9:22 
GeneralRe: OfficeXP visual style??? Pin
leppie25-Sep-02 13:15
leppie25-Sep-02 13:15 
General.NET Everett Changes Pin
David Stone24-Sep-02 12:31
sitebuilderDavid Stone24-Sep-02 12:31 
GeneralRe: .NET Everett Changes Pin
leppie24-Sep-02 13:31
leppie24-Sep-02 13:31 
GeneralCollection Editor Pin
Tomas Petricek24-Sep-02 12:05
Tomas Petricek24-Sep-02 12:05 
GeneralRe: Collection Editor Pin
leppie24-Sep-02 13:57
leppie24-Sep-02 13:57 
GeneralRe: Collection Editor Pin
Tomas Petricek25-Sep-02 2:43
Tomas Petricek25-Sep-02 2:43 
GeneralRe: Collection Editor Pin
Tomas Petricek25-Sep-02 3:46
Tomas Petricek25-Sep-02 3:46 
GeneralRe: Collection Editor Pin
leppie25-Sep-02 5:02
leppie25-Sep-02 5:02 
GeneralRe: Collection Editor Pin
Tomas Petricek25-Sep-02 6:43
Tomas Petricek25-Sep-02 6:43 
GeneralRe: Collection Editor Pin
leppie25-Sep-02 7:30
leppie25-Sep-02 7:30 
GeneralRe: Collection Editor Pin
Tomas Petricek25-Sep-02 9:25
Tomas Petricek25-Sep-02 9:25 
GeneralProblem with DrawString in OnPrintPage handler Pin
Rado24-Sep-02 11:17
Rado24-Sep-02 11:17 
Hello everybody,

I have a strange problem with DrawString in my OnPrintPage event handler Frown | :( I need to print a few lines of text (field names) that is right-aligned. I'm using StringFormat to set the text alignemt and a RectangleF instance to set the coordinates. This is the code snippet:


StringFormat formatRight=new StringFormat();<br />
formatRight.Alignment=StringAlignment.Far;<br />
....<br />
RectangleF rectRight=new RectangleF(m_nMarginLeft+80,m_nMarginFields, 50, 30);<br />
e.Graphics.DrawString("Field name 1:", m_fontField, Brushes.Black, rectRight, formatRight);<br />
e.Graphics.DrawString("Field 1 value ...", m_fontGeneric, Brushes.Black, rectRight.Right, (float)(rectRight.Top-0.5));<br />
<br />
rectRight.Offset(0,m_fontGeneric.GetHeight(e.Graphics));<br />
e.Graphics.DrawString("Looong field name 2:", m_fontField, Brushes.Black, rectRight, formatRight);<br />
e.Graphics.DrawString("Field 2 value ...", m_fontGeneric, Brushes.Black, rectRight.Right, (float)(rectRight.Top-0.5));<br />
...



(Page units are milimeters) The problem is, that the fields are actually not exactly right aligned. The longer the text is, the more it is offset to the left (i.e. when printing it makes some 2 milimeters difference for field names which are twice/half the size of each other). The same thing happens when I use one multi-line string in a rectangle of larger height. I have absolutely no clue of what can be wrong? Confused | :confused: Therefore any clues are highly appreciated Smile | :) Am I doing something stupid or what? Thanks for any help.

Have a nice day,
Rado
GeneralGetting info on drives Pin
Wjousts24-Sep-02 9:34
Wjousts24-Sep-02 9:34 

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.