Results 1 to 7 of 7

Thread: multiline

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506

    multiline

    how do i stop a multiline edit box from entering a cf/vbcrlf watever wen i press enter?

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    VB Code:
    1. Private Sub Text1_KeyPress(KeyAscii As Integer)
    2.     KeyAscii = IIf(KeyAscii = vbCrLf,0,KeyAscii)
    3. End Sub

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Hyperactive Member ZeroCool's Avatar
    Join Date
    Feb 2002
    Location
    In front of my computer
    Posts
    423
    edit box?
    do you mean Textbox?
    Visual Baisc 6 (SP5)
    Windows Xp

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506
    that gives me a type mismatch m8

  5. #5
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Originally posted by adzzzz
    that gives me a type mismatch m8
    Sorry, I keep forgetting that vbCrLf is the actual character(s), not the number . Try replacing vbCrLf with vbKeyReturn.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  6. #6
    Frenzied Member macai's Avatar
    Join Date
    Jul 2001
    Location
    Napanoch NY
    Posts
    1,228
    VB Code:
    1. Private Sub Text1_Change()
    2.  Text1.Text = Replace(Text1.Text, vbNewLine, "")
    3. End Sub
    This
    help?
    Luke

  7. #7
    Megatron
    Guest
    Try
    Code:
    Private Sub Text1_KeyPress(KeyAscii As Integer)
        If KeyAscii = vbKeyReturn Then KeyAscii = 0
    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