Difficulties accessing rich text box

ironfistchamp

Active member
Joined
Dec 9, 2005
Messages
29
Programming Experience
Beginner
Ok so the setup I have is that there are tab pages (with rtbs inside) created dynamically.

I don't know the name of the current rtb but i need to change its properties. I used a for statement to find out if the selected tabs control was an rtb. That works for saving, opening and printing but there are some rtb specific things I need to change but I can't access them because it is just showing the generic properties for a control (I presume). Is there some way that I can directly access the poperties of the rtb? Perhaps some way I can extract it's name from the control and then use that.

Ugh this wouldn't be so hard if it wasn't dynamic :p

Thanks very much

Ironfistchamp
 
VB.NET:
dim rtb as richtextbox
for each ctrl as control in tabpage.controls
  if typeof ctrl is richtextbox then
    rtb=directcast(ctrl, richtextbox)
    exit for
  end if
next
now you can work with rtb which is the ricttextbox object on the tabpage
 
Thanks very much JohnH

you really are a genius. You have practically written this whole program for me


Thanks very much

Ironfistchamp
 
Back
Top