|
-
May 24th, 2002, 12:09 PM
#1
Thread Starter
Addicted Member
Collections
I need to get all of the richtextboxes on my form:
VB Code:
Dim rText As RichTextBox
For Each rText In frmNew.Controls
Next rText
doesn't works, gives an "type mismatch" error
VB Code:
Dim rText As Control
For Each rText In frmNew.Controls
Next rText
does work, but then i get all of my controls
how do i get only my richtextboxes?
thanks
-
May 24th, 2002, 12:20 PM
#2
Addicted Member
Try
VB Code:
Dim rText As VB.RichTextBox
Instead of
-
May 24th, 2002, 12:24 PM
#3
Thread Starter
Addicted Member
thx for reply
when i try dim rText as vb. richttextbox isn't there, there's picturebox, textbox, ... but not picturebox
-
May 24th, 2002, 12:29 PM
#4
Addicted Member
How did you put the richtexbox on your form?
-
May 24th, 2002, 12:30 PM
#5
Thread Starter
Addicted Member
-
May 24th, 2002, 12:35 PM
#6
Addicted Member
Will Dim rText As VB.TextBox work?
What's the diff between RichTextBox & TextBox?
-
May 24th, 2002, 12:37 PM
#7
Thread Starter
Addicted Member
well if you do dim rText as VB.Textbox and then use:
VB Code:
For Each rText in frmNew.Controls
Next rText
then it would probably take all textboxes if it would work
-
May 24th, 2002, 01:05 PM
#8
Do this:
Code:
Dim rText As Control
For Each rText In frmNew.Controls
If TypeName(rText)="RichTextBox" Then
msgbox "HI"
End If
Next rText
Hope this helps,
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
|