Results 1 to 4 of 4

Thread: Indent Probs

  1. #1

    Thread Starter
    Lively Member lavarock09's Avatar
    Join Date
    Jun 2005
    Posts
    124

    Indent Probs

    Hey Guys,

    I Have This Code For My Indent
    VB Code:
    1. Private Sub Image13_Click()
    2. Frame2.Visible = True
    3. End Sub

    ^^^^Above Is The Code Which Shows The Frame Called Frame 2 Which Has A Text Box(Called text1) And A Button (Called Command2),

    VVVV Below Is The Code For The Frame

    VB Code:
    1. Private Sub Command2_Click()
    2. Dim indentamount As Integer
    3. indentamount = Text1.Text
    4. If indentamount >= 9000 Then
    5. MsgBox ("Number Must Be Under 9000") And ""
    6. End If
    7. RichTextBox1.SelIndent = indentamount
    8. Frame2.Visible = False
    9. End Sub

    The Above isn't Right, because What it Should Do Is Make It So The User Can Choose The Indent Size.

    and if the number inputted is MORE than 9000 it displays a MsgBox Saying "Number Must Be Under 9000" And Reset The Textbox but i can't get it to work

    Can You help?

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Indent Probs

    If indentamount >= 9000 then
    Msgbox "Indent Amount must be less than 9000"
    text1 = ""
    text1.setfocus
    exit sub
    end if
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Lively Member lavarock09's Avatar
    Join Date
    Jun 2005
    Posts
    124

    Re: Indent Probs

    thanx, and how do I make the textbox only accept numbers as entries

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Indent Probs

    Use the KeyPress event:

    VB Code:
    1. Private Sub Text1_KeyPress(KeyAscii As Integer)
    2.   Select Case KeyAscii
    3.     Case Asc("0") To Asc("9")
    4.     Case Else
    5.       KeyAscii = 0
    6.   End Select
    7. 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