wardrobeandrew Posted July 5, 2003 Posted July 5, 2003 does any one know how to save from components declared in functions or sub routine in my case its a richtext which is declared in the function and only know to that function and placed in to document manager which i got from divil.co.uk/net heres the syntax i used to declare it Private Sub newdoc() Dim rtbText As New RichTextBox rtbText.BorderStyle = BorderStyle.None rtbText.ScrollBars = RichTextBoxScrollBars.Vertical rtbText.WordWrap = True rtbText.Multiline = True rtbtext.ScrollBars = ScrollBars.Vertical Dim doc As New Document(rtb, "New Document") docMain.AddDocument(doc) End Sub i want to know how to save from that but it is only known locally to the sub newdoc() i also would like to to know how to change the fonts and in the box but but i ill work that out once i find out how to access the richtext box from out side the sub if anyone can help i'll be chuffed Quote
hog Posted July 6, 2003 Posted July 6, 2003 I would either rdeclare the rtbText as Public or have a Public object and assign rtbText to it once you have created it. There probably is a better way but it's 7:34am, I just got up so my brain is still asleep:) Quote My website
*Experts* mutant Posted July 6, 2003 *Experts* Posted July 6, 2003 You could declare it without an instance where all subs and functions can access it and then in the newdoc sub just create an instance from that variable, it will accessible to all subs and functions in the class. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.