View Single Post
 
Old 04-15-2017, 03:36 AM
Cambalinho_83's Avatar
Cambalinho_83 Cambalinho_83 is offline
Senior Contributor
 
Join Date: Feb 2008
Location: somewhere in space
Posts: 1,296
Default VB 2010 - RichTextbox: how wrap and resize a table?

heres how i insert a table:
Code:
'add a description to a procedure\funtion
    '''<summary>
    ''' Description: Inserts a Wraped Text Table
    ''' </summary>
    Public Sub InsertTable(rows As Integer, cols As Integer, width As Integer)
        Dim sbTaRtf As New System.Text.StringBuilder
        sbTaRtf.Append("{\rtf1")
        For index As Integer = 1 To rows
            sbTaRtf.Append("\trowd")
            For columns As Integer = 1 To cols
                sbTaRtf.Append("\cellx" & (width * (columns)).ToString)  'set that cell width to 1000
            Next
            sbTaRtf.Append("\intbl \cell \row")
        Next
        sbTaRtf.Append("\pard")
        sbTaRtf.Append("}")
        Me.SelectedRtf = sbTaRtf.ToString 'me it's my RichTextBox Inherited UserControl
    End Sub
from these RTF text i see 2 problems:
1 - how can word wrap the text on cell?
2 - using the mouse, how can i resize the cell table?
Reply With Quote