|
-
Oct 22nd, 2007, 01:19 AM
#1
Thread Starter
New Member
Strange problem with richtextbox
Hi, I am sure I had this working before, and after I implemented another feature of it now it is not working, and removing the feature that I recently added its still not working.
If I had a RichTextBox, and I implement this in KeyUp function
Call test(RichTextBox1)
And put this in the form
Private Sub test(textbx As TextBox)
MsgBox 'i am here'
End Sub
It does not even enter the test sub (). Why?
Private Sub test(textbx As control)
this works. not sure why textbox wouldn't though
Last edited by Hack; Oct 22nd, 2007 at 05:25 AM.
-scmay-
-
Oct 22nd, 2007, 05:25 AM
#2
Re: Strange problem with richtextbox
-
Oct 22nd, 2007, 05:28 AM
#3
Addicted Member
Re: Strange problem with richtextbox
textbox, i believe is a reserved name, since you can go dim x as textbox
-
Oct 22nd, 2007, 07:11 AM
#4
Re: Strange problem with richtextbox
It is, but he didn't use TextBox as a variable name, but rather as a type.
Incidentially, if you are using a richtextbox, then your type should be that, not TextBox. This worked just fine for me.
vb Code:
Option Explicit
Private Sub Test(TextBx As RichTextBox)
MsgBox "Hello"
End Sub
Private Sub Command1_Click()
Test RichTextBox1
End Sub
-
Oct 22nd, 2007, 07:33 AM
#5
Addicted Member
Re: Strange problem with richtextbox
Oh, i thought he was saying he was trying to use textbox as the variable name:
Code:
Private Sub test(textbox As TextBox)
MsgBox 'i am here'
End Sub
But i can see why it didnt work, now that i see what he was doing.
-
Oct 25th, 2007, 01:59 AM
#6
Thread Starter
New Member
Re: Strange problem with richtextbox
 Originally Posted by Hack
How did you call it?
Call test(RichTextBox1)
Declaring it as RichTextBox will work too. I just realized that out of the 3 textboxes 1 that wasn't working was because I made it a control array, and that somehow doesn't make it go to the test()
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
|