Results 1 to 2 of 2

Thread: wordwrap

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    4

    Question

    I am new to VB Programming. I created a little Notepad like application. But I can't add the "WordWrap" functionality of the windows notepad to it. The textbox wordwraps when its scrollbars property is set to vertical. And it doesn't wordwrap when it's set to both. BUT, when I go to change this property at run time(on mnuEditWordWrap_Click event), a compile-error occurs "Can't assign to readonly property". What can I do now?
    Andaleeb

  2. #2
    Guest
    It may appear like Notepad disables and enables Scrollbar's but in reality, it uses 2 different TextBoxes. When you set WordWrap to True, it makes one TextBox visible and the other invisible and vise versa.

    Code:
    Private Sub mnuWordWrap_Click()
    
        mnuWordWrap.Checked = Not mnuWordWrap.Checked
        
        If mnuWordWrap.Checked = True Then
            'If it's checked then make the WordWrap TextBox visible
            TextWordWrap.Visible = True
            TextNoWordWrap.Visible = False
        Else
            'If not then make the other one visible
            TextWordWrap.Visible = False
            TextNoWordWrap.Visible = True
        End If
        
    End Sub

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