[VB2010] - RTF format: how change row height?:(
i have these nice sub for insert a table:
Code:
Public Sub InsertTable(ByVal Rows As Integer, ByVal Columns As Integer, Optional ByVal ColWidth As Integer = 700, Optional ByVal RowHeight As Integer = 2000) Dim _Rtf As String
_Rtf = "\par"
' I Fixed the column size here you can change it on your own
For row As Integer = 1 To Rows
_Rtf &= "\trowd\trautofit1\trgaph108\trrh" & (RowHeight * row).ToString & "\trleft36" 'these last comand is the left row position
'The following For loop is just an example you make a list of columnWidth and and you can assign it here
For col As Integer = 1 To Columns
_Rtf &= "\clbrdrt\brdrdb\brdrsh\brdrs\clbrdrr\brdrdb\cellx" & (ColWidth * col).ToString
Next
_Rtf &= "\pard"
_Rtf &= "\intbl\row"
Next
_Rtf &= "\pard"
Dim tmpstr As String = Me.Rtf
Me.Rtf = tmpstr.Insert(tmpstr.LastIndexOf("\par" & tmpstr.Chars(tmpstr.Length - 2)), _Rtf)
End Sub
i have read that the "\trrhN" RTF command is for change the row height and the 'N' is the size. if so why don't change the row height?:(
Re: [VB2010] - RTF format: how change row height?:(
Open in WORDPAD to see the changes. RTF changes every few years. It was 600 pages 10 years ago. You can download it.
Re: [VB2010] - RTF format: how change row height?:(
Quote:
Originally Posted by
dglienna
Open in WORDPAD to see the changes. RTF changes every few years. It was 600 pages 10 years ago. You can download it.
heres the result:
Code:
{\rtf1\ansi\ansicpg1252\deff0\deflang2070{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}\viewkind4\uc1\pard\f0\fs17\par
\trowd\trgaph108\trleft36\cellx700\cellx1400\cellx2100\cellx2800\cellx3500\pard\intbl \cell\cell\cell\cell\cell\row
\intbl \cell\cell\cell\cell\cell\row
\intbl \cell\cell\cell\cell\cell\row
\intbl \cell\cell\cell\cell\cell\row
\intbl \cell\cell\cell\cell\cell\row
\pard\par
}
big question: where is the "\trrhN" command?
Re: [VB2010] - RTF format: how change row height?:(
Quote:
Originally Posted by
Cambalinho
i have read that the "\trrhN" RTF command is for change the row height and the 'N' is the size. if so why don't change the row height?:(
A quick observation showed me that your code should be fine. You do realize though that you must set the row height and width properties in Twips?
A twip is 1/20 ( one twentyith ) of a point. 72 points are equal to one inch. Therefore 1440 twips are one inch (72 times 20)
Also, have a look here :
http://www.biblioscape.com/rtf15_spec.htm#Heading40
Re: [VB2010] - RTF format: how change row height?:(
Quote:
Originally Posted by
HanneSThEGreaT
A quick observation showed me that your code should be fine. You do realize though that you must set the row height and width properties in Twips?
A twip is 1/20 ( one twentyith ) of a point. 72 points are equal to one inch. Therefore 1440 twips are one inch (72 times 20)
Also, have a look here :
http://www.biblioscape.com/rtf15_spec.htm#Heading40
heres the new code:
Code:
"\trowd \trgaph108 \trqc \ltrrow \trleft3 \trrh" & (RowHeight * row).ToString & " \trhdr \trkeep"
and what the textbox show me:
Code:
{\rtf1\ansi\ansicpg1252\deff0\deflang2070{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17\par
\trowd\trgaph108\trleft3\trqc\cellx700\cellx1400\cellx2100\cellx2800\cellx3500\pard\intbl \cell\cell\cell\cell\cell\row
\intbl \cell\cell\cell\cell\cell\row
\intbl \cell\cell\cell\cell\cell\row
\intbl \cell\cell\cell\cell\cell\row
\intbl \cell\cell\cell\cell\cell\row
\pard\par
}
i see 2 bad things:(
1 - the cell have the standard height;
2 - the textbox don't show me the "\trrh" comand:(