空白に関しては、私はあまりにも混乱しています。私は弦をパドライトしようとしていますが、それは私と協力しません。
datagridviewを印刷したいので、列ヘッダーとその下に実際の行があります。文字列を埋めるために正確な長さまたは幅をどのように決定しようとしても、それは短すぎるか長すぎます。そのため、プリンターに送信する前に、値を列ヘッダーに揃えることができません。
たとえば、次のことを行うだけの場合:
thestring := '.NET is cool';
thestring := thestring.padright(100); //thestring = too short = '.NET is cool '
私がこれを行う場合:
var tmpstr := '=';
tmpstr := tmpstr.PadRight(15); //total length of characters is 15
var swidth := int32(ev.Graphics.Measurestring(tmpstr,new Font('Arial',9)).Width);
thestring := '.NET is cool';
thestring := theString.padright(swidth); //thestring = too long = '.NET is cool
'
PadRightまたはPadLeftは、空白ではなく実際の文字を渡すと正しく機能するように見えますが、間違っている可能性があります。
任意の入力またはヘルプは大歓迎です。