Volevo chiedere se sapete dirmi come calcolare la distanza che devo impostare tra un campo e l'altro durante la creazione di una stampa in vb2010.
infatti se scrivo :
- Codice: Seleziona tutto
str = ""
If Not IsDBNull(dts.Tables("Righe").Rows(i).Item(12)) Then str = dts.Tables("Righe_estratte").Rows(i).Item(12)
e.Graphics.DrawString((str.PadLeft(8 - Len(str))), Font_riga, Brushes.Black, 30, Y)
' gruppo 1
str = ""
If Not IsDBNull(dts.Tables("Righe").Rows(i).Item(7)) Then str = dts.Tables("Righe_estratte").Rows(i).Item(7)
e.Graphics.DrawString((str.PadLeft(2 - Len(str))), Font_riga, Brushes.Black, 40, Y)
scrivo la prima str al punto 30. Quindi pensando che la prima str è lunga 8, provando a scrivere la seconda str a 40 (30+8+2) il testo mi viene sovrapposto al primo.
C'e' un modo per calcolare quanto è lunga la prima str cosi' da impostare il punto in cui stampare il secondo ?
Grazie