Results 1 to 29 of 29

Thread: Changing text in textbox once something is erased

Threaded View

  1. #14
    Hyperactive Member
    Join Date
    Feb 2006
    Location
    Melbourne, Australia
    Posts
    415

    Re: Changing text in textbox once something is erased

    After rethinking the problem, the delete-watcher really wasn't necessary
    Use your original program, and try this:
    VB Code:
    1. Dim keyWord As String
    2.     Dim searchCount As Integer
    3.     Dim notFinished As Boolean
    4.  
    5. Private Sub cmdAddNum_Click()
    6.     searchCount = 0
    7.     notFinished = True
    8.     keyWord = " "
    9.        
    10.     Do While notFinished
    11.         searchCount = searchCount + 1
    12.         If InStr(1, txtDesign.Text, keyWord & GetRoman(searchCount) & ".") = 0 Then
    13.             NextRoman = searchCount
    14.             notFinished = False
    15.         End If
    16.     Loop
    17.    
    18.     NextAlpha = 0
    19.     txtDesign.Text = txtDesign.Text & (GetRoman(NextRoman) & ". ")
    20.     txtDesign.SelStart = Len(txtDesign.Text)
    21.     txtDesign.SetFocus
    22. End Sub

    This will search for any missing numeral in the text.
    Replace
    VB Code:
    1. keyWord = " "
    with anything you choose which will be the identifier for the numeral.

    As for the King George V. problem, this will only cause confusion if it is written as the 4th statement, and it will skip the 5th roman numeral.

    If X is written in the 9th statement, the 10th roman numeral will be skipped.

    This shouldn't be too much of a problem, and the only way I can see to avoid this is to insert an indentifier before the roman numeral.

    Hope thats useful
    Last edited by Rob123; Mar 21st, 2006 at 06:36 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width