Set Calling FORM Visible = False by CALLED FORM

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lenniekuah
    New Member
    • Oct 2006
    • 126

    Set Calling FORM Visible = False by CALLED FORM

    Hi Good Guys,
    I have an interesting problem and I need your help.
    Please Help me.

    Requested were made by Businese Analyst to set the few Main FORMs VISIBLE PROPERTY TO FALSE when the POPUP FORM is loaded.
    Code:
     MAIN FORM NAME                  POPUP FORM 
    FRMSALES                         FRMPOPUPCUSTOMER
    FRMTRANS                         FRMPOPUPCUSTOMER
    FRMSHIPPER                       FRMPOPUPCUSTOMER
    FRMINVOICE                       FRMPOPUPCUSTOMER

    When the MAIN FORM loads the POPUP FORM,
    on the FRMPOPUPCUSTOME R-FORMLOAD even, it has to set the MAIN FORM Visible to False.

    When FRMPOPUPCUSTOME R FORM IS UNLOAD it has to set the MAIN FORM Visible = TRUE.

    How to the coding is to ensure that different MAIN FORM when loaded FRMPOPUPCUSTOME R it will turn the MAIN FORM Visible to FALSE.
  • dip_developer
    Recognized Expert Contributor
    • Aug 2006
    • 648

    #2
    Dim popupform As New PopupForm()
    popupform.Show
    me.Hide()

    Comment

    • lenniekuah
      New Member
      • Oct 2006
      • 126

      #3
      Hullo Good Guys,
      Thanks to all of you for your share of sample codings with me. I have modify to suit my application and environment. It's now Working very well.

      Here are the coding that I want to share with other Newbies who may have similar problems and need helps.

      Code:
      'This FORM called FrmCustMaint
      Option Explicit On
      
      Public Class FrmMain
       
      Private Sub btnCustomer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCustomer.Click
      
              Dim FM As New FrmCustMaint
              Dim callFrm As System.Windows.Forms.Form = Me
      
              FM.PropCallForm = callFrm
              FM.ShowDialog()
              FM = Nothing
       End Sub
      End class
      
      ---------------------------------------------------
      Option Explicit On
      
      Public Class FrmCustMaint
         
          Private FrmCall As System.Windows.Forms.Form
      
       Private Sub FrmCustMaint_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
      		Handles MyBase.Load   
              FrmCall.Visible = False
      End sub
      
       Public Property PropCallForm()
              Get
                  Return FrmCall
              End Get
              Set(ByVal value)
                  FrmCall = value
              End Set
        End Property
      End Class

      Comment

      Working...