|
-
Jul 5th, 2005, 03:38 PM
#1
Thread Starter
Lively Member
Indent Probs
Hey Guys,
I Have This Code For My Indent
VB Code:
Private Sub Image13_Click()
Frame2.Visible = True
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:
Private Sub Command2_Click()
Dim indentamount As Integer
indentamount = Text1.Text
If indentamount >= 9000 Then
MsgBox ("Number Must Be Under 9000") And ""
End If
RichTextBox1.SelIndent = indentamount
Frame2.Visible = False
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?
-
Jul 5th, 2005, 03:42 PM
#2
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"
-
Jul 5th, 2005, 03:48 PM
#3
Thread Starter
Lively Member
Re: Indent Probs
thanx, and how do I make the textbox only accept numbers as entries
-
Jul 5th, 2005, 04:16 PM
#4
Re: Indent Probs
Use the KeyPress event:
VB Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case Asc("0") To Asc("9")
Case Else
KeyAscii = 0
End Select
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|