Setting Table size in VB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • VickyC
    New Member
    • Mar 2008
    • 3

    #1

    Setting Table size in VB

    Good Afternoon,

    I have created a Bill template in Word 2003, which I have written in Visual Basic 6.5.

    It has options to add anything from 1-4 costs and 1-4 disbursements, There is 2 tables on table adds the text, amount and VAT in to the relevant columns adding addtional rows.

    The second table is within the footer that holds the totals.

    I origionally created it so that the last row would resize itself, so that it would meet the 2nd table although depending on how much text is entered it does override.

    Is there any way to set the table to resize to a set size but also not exceed that size, maybe warn users when running out of space..?

    I have been researching this for days and can not find any information on this, so any help would be much appreciated.

    Thanks in advance... Vicky
  • Semajthewise
    New Member
    • Nov 2007
    • 38

    #2
    I am assuming that the user is entering the infomation in the form with this solution.
    If thats not the case ignore this.

    you might consider an ontextchanged event like this

    Place on the box used for entry of data

    [code=vbnet]
    private Sub boxname_TextCha nged(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles boxname.TextCha nged

    'checking string length
    dim iLength as integer = boxname.length
    dim iLongest as integer = " the longest you want the string"
    dim iLeft as integer = "some amount less than the max length when you want to give warning"
    If sLength = iLeft then
    MessageBox.Show ("You may enter only __ more characters", "Warning!!" )
    Elseif iLength = iLongest then
    MessageBox.Show ("You have reached the maximum length","Warnin g!!!")
    else
    End If
    End Sub
    [/code]
    This is in .net 2003 but it should work for you.

    Comment

    Working...