Using MDI Parents

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts Page 1 of 1
Contributors
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Using MDI Parents
GoodGuy17
Hello,
I was inspired to make a program like B++ after I saw agust1337's post. I am using a PropertyGrid to edit the controls. In a timer event, I want the NumericUpDown's max value to go to the amount of controls in the current MDI Child. Then, I want the PropertyGrid to have the selected item's properties. I want the user to be able to change the properties of a control added at runtime on the open MDI Child in a PropertyGrid.
~GoodGuy17 :D
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Using MDI Parents
mandai
You could always just set the numericupdown's maximum in the MdiChildActivate event.

Check out:
Code: Select all
    Dim pg As PropertyGrid = New PropertyGrid()

    Private Sub MDIParent1_MdiChildActivate(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.MdiChildActivate
        NumControlIndex.Maximum = Me.ActiveMdiChild.Controls.Count - 1
    End Sub

    Private Sub NumControlIndex_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumControlIndex.ValueChanged
        Dim childIndex As Integer = Array.IndexOf(Me.MdiChildren, Me.ActiveMdiChild)

        If childIndex > -1 Then
            pg.SelectedObject = Me.MdiChildren(childIndex).Controls(Convert.ToInt32(NumControlIndex.Value))
        End If
    End Sub
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Re: Using MDI Parents
GoodGuy17
Thank you mandai, I am going to set up another request for listboxes and reading from file. Take a look if you like.
3 posts Page 1 of 1
Return to “Tutorial Requests”