Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2007

Tip: Looking for answers? Try searching our database.

Accessing form's text box from Module

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Elmo Watson - 07 Jan 2007 03:08 GMT
I have come from a VB6 background, and I'm trying to convert an MDI app that
has many subs in modules which directly access
a textbox in a child form of the main MDI form (frmMain as MDI form, frmEdit
as child form, txtEdit as richtextbox)
code:
With frmMain.ActiveMdiChild.txtEdit

I totally understand OO concepts now, which I didn't (completely) when the
app was originally written, but I really don't want to re-write every single
sub and make it a function, to output text - that would make me want to
shoot the computer.
I guess, the other option would be to put all this stuff in the MDI form or
MDI child, however, that would really bloat those forms....(IMHO)

Is there a way to reference the textbox on the child form, directly inside a
module, with VB.Net (2005)?
Stephany Young - 07 Jan 2007 03:24 GMT
You mean like?:

 Module xyz

   Public Sub UpdateRichTextBox()

     CType(CType(Application.OpenForms("frmMain"), frmMain).ActiveMdiChild,
frmEdit).txtEdit.Text = "The quick brown fox ..."

   End Sub

 End Module

>I have come from a VB6 background, and I'm trying to convert an MDI app
>that has many subs in modules which directly access
[quoted text clipped - 12 lines]
> Is there a way to reference the textbox on the child form, directly inside
> a module, with VB.Net (2005)?
Elmo Watson - 07 Jan 2007 05:05 GMT
Absolutely great! I've been looking for this for so long

I just dimmed that all as a RichTextBox at the head of the Module and
everything went perfectly

Thanks! - You're a life saver

> You mean like?:
>
[quoted text clipped - 25 lines]
>> Is there a way to reference the textbox on the child form, directly
>> inside a module, with VB.Net (2005)?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.