473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to close one form while opeing other form in vb.net

Hi,
I am new to vb.net. Please help me in ..
I have two form in my application. when i put some data from second from to first form i want to close second form.
I am using me.close, but it's not working, the form still remains open.
Please help me
Thanks in advance.
Nov 17 '07 #1
6 1927
Shashi Sadasivan
1,435 Expert 1GB
have you tried debugging it? by putting a breakpoint at the line where you close the form, and checking if that line is processed when you want it ?
Nov 17 '07 #2
have you tried debugging it? by putting a breakpoint at the line where you close the form, and checking if that line is processed when you want it ?

Yes i have debugged and that line is executing properly, but not closing the form. I am attaching my code for you reference.

Dim RoleMaster As New frmRoleMaster
GetRole = "LoadMode"
RoleMaster.txtRoleName.Text = grdRoleView.Item(grdRoleView.CurrentRowIndex, 0)
If IsDBNull(grdRoleView.Item(grdRoleView.CurrentRowIn dex, 1)) = True Then
RoleMaster.txtRoleDescription.Text = ""
Else
RoleMaster.txtRoleDescription.Text = grdRoleView.Item(grdRoleView.CurrentRowIndex, 1)
End If
If IsDBNull(grdRoleView.Item(grdRoleView.CurrentRowIn dex, 2)) = True Then
RoleMaster.cmbDataFilter.Text = ""
Else
RoleMaster.cmbDataFilter.Text = grdRoleView.Item(grdRoleView.CurrentRowIndex, 2)
End If
RoleMaster.txtRoleId.Text = grdRoleView.Item(grdRoleView.CurrentRowIndex, 5)
Me.Close()
GetRole = "ViewMode"
RoleMaster.ShowDialog()
Nov 17 '07 #3
Hi,

Are you saying that you are able to see the form in taskbar still?
Nov 18 '07 #4
Hi,

Are you saying that you are able to see the form in taskbar still?

Yes exactly, still i am able to see th form in taskbar
Nov 20 '07 #5
try this vb.net code
===============
me.dispose(true)
Nov 20 '07 #6
Yes exactly, still i am able to see th form in taskbar
In that case, set the property of "Show in Taskbar" of the form to false.
That would solve the problem.
Nov 20 '07 #7

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

Similar topics

6
by: marcelf3 | last post by:
Hello.. This page opens a window with some information, but everytime the user changes a field in the parent window, the child window needs to be closed. These 2 functions were supposed to do the...
1
by: Jules Winfield | last post by:
My WinForms application can have any number of top level forms open at a given time. If the user selects File|Exit, all of the forms are closed. The loop to close the forms looks something like this:...
2
by: Chien Lau | last post by:
Hi, At a certain point in my application, I have access to a Form object. I want to close that form: form.Close(); There are any number of reasons why this form might not close. A common...
8
by: Mike D | last post by:
If I have a project with 2 or more forms.. form(1) has a button to open form(2) What is the code for opening for(2)? Ex: form(2).show This doesnt work. Simply anyways.
7
by: Alice | last post by:
Hi, In my program, the user can navigate to many different forms. When they go to the next form, I want the form they have left to close. However, the forms aren't closing. Can anyone tell me...
5
by: Stan Sainte-Rose | last post by:
Hi, Which event is called when the user click on the close window icon (X) ? I want, when he clicks on this icon, to display a message before closing the form. If he replys by No, I don't want to...
6
by: Tom | last post by:
Is there ANY easy way to close a MDI Child form in the middle of it's load? For instance, during the Load event I find a need to close the form (for whatever reason - maybe the user isn't ready for...
5
by: AP | last post by:
IS there a way to run a procedure if the users close access directly rather than closing a menu screen that I have built? There is an event that works on close for this form, but it doesnt seem to...
6
by: scott | last post by:
I guess this is a simple one but I can't seem to get it to work. I want to refresh an open form "onClose" of another. I have a Close button on a form which has User Details on it. If I update...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.