Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 Control Child Form from Parent in MDI

$
0
0
I am having the hardest time accessing a child's TextBox1 property from my parent form.

This is what I have so far in my parent form:
Code:

Public Class MDITextEditor 
    Private Sub CCToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CCToolStripMenuItem.Click
        Dim child As New ChildForm()
        child.MdiParent = Me
        child.Show()
        child.Activate()
    End Sub
End Class

From my parent form, I would like to run the following code for TextBox1 located in the active child.

Code:

Private Sub fcToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fcToolStripMenuItem.Click
    TextBox1.Font = New Font("Times New Roman", 20, TextBox1.Font.Style)
End sub

I have been fiddling around with ActiveMdiChild, but to no avail.
Any help on how to do this is much appreciated!

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>