473,811 Members | 2,714 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set Calling FORM Visible = False by CALLED FORM

126 New Member
Hullo Good Friends,
I need your help. Please Help me.

I am trying to pass the name of the Calling FORM FRMSALES to the Loaded FORM FRMPOPUPCustome rs so that FRMPOPUPCustome r will set the FRMSALES visible to FALSE.

I am not sure how to do it. FRMPOPUPCustmer does not turn FRMSALES visible to FALSE.

Here are the coding from Both FORMs:

Expand|Select|Wrap|Line Numbers
  1. '--------------------------------------------------------------
  2. ' FORM        : FRMSALES.VB
  3. ' Description    : This form load FrmPOPUPCustomer to retrieve specific customer
  4. '           or Create New Customer
  5. '----------------------------------------------------------------
  6.  
  7.  Private Sub  ToolStripMenuItem_Click(ByVal sender As System.Object, _
  8.                   ByVal e As System.EventArgs) _
  9.                   Handles ToolStripMenuItem.Click
  10.  
  11.         Dim FM As New FrmCityRef
  12.         Dim callFrm As New FrmCustMaint
  13.  
  14.         FM.PropCallForm = callFrm
  15.         FM.ShowDialog()
  16.         FM = Nothing
  17.  
  18.  End Sub
  19.  
  20.  
Expand|Select|Wrap|Line Numbers
  1. '------------------------------------------------------------
  2. ' FORM         :FRMPOPUPCUSTOMER.VB
  3. ' Description    : This form uses DataGridView and TEXTBOX to create new customer record
  4. '             : It will set the CALLING FORM visible to FALSE
  5. ' --------------------------------------------------------------
  6. Option explicit ON
  7. Dim  FrmCall As Form
  8.  
  9.   Private Sub FRMPOPUPCUSTOMER_Load(ByVal sender As System.Object, _
  10.     ByVal e As System.EventArgs) _
  11.         Handles MyBase.Load
  12.  
  13.          FrmCall.Visible = False     
  14.     End Sub
  15.  
  16. Public Property PropCallForm() As Form
  17.         'retrieve calling form name to set visible off
  18.         Get
  19.             Return FrmCall
  20.         End Get
  21.  
  22.         Set(ByVal value As Form)
  23.             FrmCall = value
  24.         End Set
  25.  End Property
  26.  
  27.  Private Sub FRMPOPUPCUSTOMER_FormClosed(ByVal sender As Object, _
  28.     ByVal e As System.Windows.Forms.FormClosedEventArgs) _
  29.     Handles Me.FormClosed
  30.  
  31.         FrmCall.Visible = True
  32.  
  33. End Sub
  34.  
  35.  
  36.  
  37.  
Sep 6 '10 #1
2 1344
Joseph Martell
198 Recognized Expert New Member
I think you are pretty close to getting this working. I believe your problem is with the form that you are passing to the called form. In your ToolStripMenuIt em_Click code, you have the following lines of code:

Expand|Select|Wrap|Line Numbers
  1.          Dim FM As New FrmCityRef
  2.          Dim callFrm As New FrmCustMaint
  3.  
  4.          FM.PropCallForm = callFrm
  5.          FM.ShowDialog()
  6.          FM = Nothing
Notice that what you are doing is creating a NEW FrmCustMaint form and passing it to the called form. When you use the keyword "New" it creates a new object that has no relationship to any forms that are currently being displayed. I assume that the ToolStripMenuIt em_Click method is a member of the form that you wish to hide. If so, instead of creating a new form and passing that in you need to pass in Me:
Expand|Select|Wrap|Line Numbers
  1.          Dim FM As New FrmCityRef
  2.  
  3.          FM.PropCallForm = Me
  4.          FM.ShowDialog()
  5.          FM = Nothing
Sep 7 '10 #2
lenniekuah
126 New Member
Hi Joseph Martell
Thank you very much for your suggestion. I did try it out and it's working.
I have to modify it to suit our setup.

I would like to post it here to share it with others who may have similar problems and need help.
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnCustomer_Click(ByVal sender As System.Object, 
  2.     ByVal e As System.EventArgs) Handles btnCustomer.Click
  3.  
  4.         Dim FM As New FrmCustMaint
  5.         Dim callFrm As System.Windows.Forms.Form = Me
  6.  
  7.         FM.PropCallForm = callFrm
  8.         FM.ShowDialog()
  9.         FM = Nothing
  10.     End Sub  
---------------------------------------
Expand|Select|Wrap|Line Numbers
  1. Option Explicit On
  2.  
  3. Public Class FrmCustMaint
  4.  
  5.     Dim FrmCall As System.Windows.Forms.Form
  6.  
  7.      Private Sub FrmCustMaint_Load(ByVal sender As System.Object, 
  8.         ByVal e As System.EventArgs) Handles MyBase.Load
  9.  
  10.                 FrmCall.Visible = False
  11.     End sub
  12.  
  13.      Public Property PropCallForm()
  14.                 Get
  15.                         Return FrmCall
  16.                 End Get
  17.                 Set(ByVal value)
  18.                         FrmCall = value
  19.                 End Set
  20.         End Property
  21.  
  22. End Class 
Sep 8 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1972
by: hanct | last post by:
"this" here refer to the form.. I type this.Visible=false;..but the form still can be seen! Worst still, the property editor has no Visible property to play with..why??is that a bug?? Wat the difference between Visible=false and opacity=0;??? Posted Via Usenet.com Premium Usenet Newsgroup Services
4
2657
by: bnp | last post by:
Hi All, I am quite new the JavaScript. Basically I am a C++ programmer, but now I am working on JavaScript since last 5 days. I have a problem regarding the form validation. I have created a script that validates the form fields. the validation procedure is called ONCLICK event of the submit button. Follwowing is the structure of the validation procedure.
4
2160
by: pizzy | last post by:
INTRO: I tried to clean it up for easy reading. I hope I didn't make any mistakes. PROBLEM: WOW, this is some crazy sh!t. I can't get my checkbox (see "TAGSELECTED") to print my textboxes (see "TAG#") when more than 1 number (see "VLANS") is inputed into my form. QUESTION: How do I make my dynamic form have a dynamic input box(which is created by checking the checkbox and calling the functionC1) inside it and still be able to pass the...
5
3525
by: DraguVaso | last post by:
Hi, I have a MDIForm with some MDIChilds. When the user clicks on the "x" in the upper right corner, I don't want the MDIChild to be closed, but the property Visible = False. So far no problem: I do this useing the Form_Closing-event in which I typed: e.Cancel = True Me.Visibible = False
8
1794
by: Hansen | last post by:
Hi I have a form with multiple labels and textboxes and listboxes that need to be made visible and not visible when buttons are clicked. Is there anyway of grouping them together so that I have less lines of code instead of 100's of lines stating: LblA.Visible = True LblB.Visible = True LblC.Visible = True
4
2668
by: Jimmy Stewart | last post by:
I have a calculated control "ContactInfo" on my form ... ="Attn: " & In the OnCurrent event for the form I have the following code... If Me.Contact Is Null Then Me.ContactInfo.Visible = False End If The idea is, that if there is no contact listed (I have the contact field on the form with visible property set to no) then this line will not display.
5
7502
by: | last post by:
How can i make my form invisible public class Form1 : System.Windows.Forms.Form static void Main() {
8
4017
by: Doc John | last post by:
I have an MDI container with a child Form which will be visible according to certain events. The problem is that when I set the property Visible to False and then back to True, the Form will be in another location, or it will be maximized. Why does the child Form change its location when the Visible propery is set true (after being set to False)? Why doesn't it stay with the same Size and the same Location? Thanks.
2
6977
by: Thelma Roslyn Lubkin | last post by:
If I close and reopen the form I lose its changes even if I set acSave to yes when closing. So I'm trying to keep the form open throughout but making it visible only when necessary. So how can I set the visible property from code in the calling form? thanks, --thelma
6
2504
by: mjworks2009 | last post by:
I'm creatig a data base and in my front page i have 3 sub forms and 3 buttons for the sub forms to activate or not. 1. Subform1 is where all the current list of the patients being admitted for consultation. This form is Visible=True upon Form_Load(). 2. Subform2 is where all the list of patient's name. This form is Visible=False upon Form_Load(). 3. Subform3 displays the patient's personal information and the result entries (it is...
0
9727
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10133
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9204
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.