Results 1 to 3 of 3

Thread: Create in ToolStrip and other form

  1. #1

    Thread Starter
    Addicted Member Tengkorak's Avatar
    Join Date
    Nov 2006
    Posts
    240

    Create in ToolStrip and other form

    I have 3 form :
    * MDIForm (Main Menu)
    * frmMemberList (To Display Member List)
    * frmMember (To CRUD Member)

    In MDIForm I have ToolStrip where there some buttons (add, modify, delete, preview and close)

    I want to create an event where if you click the Add button he will call frmMember

  2. #2
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: Create in ToolStrip and other form

    Please, define, do you need a new instance of frmMember of the existing one (if any)?

    For a new one:
    vb Code:
    1. Private Sub ButtonAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ButtonAdd.Click
    2.     Dim f As New frmMember
    3.     f.Show()
    4. End Sub

  3. #3
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Create in ToolStrip and other form

    Without going down the interface root and to keep it simple, you check the type of the current selected child using Form.ActiveMDIChild. You can then call a method on that form by casting it first. Something like this:

    Code:
    If TypeOf Me.ActiveMdiChild Is frmMember Then
       DirectCast(Me.ActiveMdiChild,frmMember).AddEntry 
    End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width