Hi all
I have an application in wich you can insert a new costumer, and like in
Microsoft Outlook 2003, and option "Save and New".
To deal this, I have an event in the edit form, that is raised when the user
saves the customer information. If the property "CreateNew" that comes along
with the custom EventArgs is true, then the child form creates a new form for
this.
Here is the code:
private void edit_Save(object sender, Edit.SaveEventArgs e)
{
if (e.CreateNew)
new();
}
It works fine, but after saving and getting the new screen, the previous
form is still on the screen and only closes when I close the second one - and
it goes on and on until I stop using this function. I believe this happens
because the function is still on (edit_Save). How can I prevent that, with
simplicity, please?
Thanks. 3 3317
Just a correction: The function is in the parent form, not in the child.
"Bruno Rodrigues" wrote: Hi all I have an application in wich you can insert a new costumer, and like in Microsoft Outlook 2003, and option "Save and New". To deal this, I have an event in the edit form, that is raised when the user saves the customer information. If the property "CreateNew" that comes along with the custom EventArgs is true, then the child form creates a new form for this. Here is the code:
private void edit_Save(object sender, Edit.SaveEventArgs e) { if (e.CreateNew) new(); }
It works fine, but after saving and getting the new screen, the previous form is still on the screen and only closes when I close the second one - and it goes on and on until I stop using this function. I believe this happens because the function is still on (edit_Save). How can I prevent that, with simplicity, please?
Thanks.
Salam
As far as i understand ur problem is that, when New Form Opens , u want to
close the previous form, you can do it by simply closing the current form
before the new statement.
--
ALI RAZA SHAIKH
MCAD.net www.programmersparadise.cjb.net
alirazashaikh.blogspot.com
"Bruno Rodrigues" <Br************@discussions.microsoft.com> wrote in
message news:3A**********************************@microsof t.com... Just a correction: The function is in the parent form, not in the child.
"Bruno Rodrigues" wrote:
Hi all I have an application in wich you can insert a new costumer, and like in Microsoft Outlook 2003, and option "Save and New". To deal this, I have an event in the edit form, that is raised when the user saves the customer information. If the property "CreateNew" that comes along with the custom EventArgs is true, then the child form creates a new form for this. Here is the code:
private void edit_Save(object sender, Edit.SaveEventArgs e) { if (e.CreateNew) new(); }
It works fine, but after saving and getting the new screen, the previous form is still on the screen and only closes when I close the second one - and it goes on and on until I stop using this function. I believe this happens because the function is still on (edit_Save). How can I prevent that, with simplicity, please?
Thanks.
I do it, and this is my doubt.
private void saveAndNew()
{
// ... some DB Save Routine here...
if (Save != null)
{
Close(); // Closes the form
SaveEventArgs e = new SaveEventArgs();
e.CreateNew = true;
Save(this, e); // Raises the event in the top form
}
}
Now the top form event:
private void edit_Save(object sender, Edit.SaveEventArgs e)
{
if (e.CreateNew)
new();
}
It's working ok, but when the "new();" function is trigerred and the new
form is shown, the last opened form remains open in the background. When I
close the second form, then the old one closes also. If I use saveNew in the
second form also, then both forms will stay open in the background. It's like
the screen is not redrawing itself.
Thanks
"ALI RAZA" wrote: Salam
As far as i understand ur problem is that, when New Form Opens , u want to close the previous form, you can do it by simply closing the current form before the new statement.
-- ALI RAZA SHAIKH MCAD.net
www.programmersparadise.cjb.net alirazashaikh.blogspot.com
"Bruno Rodrigues" <Br************@discussions.microsoft.com> wrote in message news:3A**********************************@microsof t.com... Just a correction: The function is in the parent form, not in the child.
"Bruno Rodrigues" wrote:
Hi all I have an application in wich you can insert a new costumer, and like in Microsoft Outlook 2003, and option "Save and New". To deal this, I have an event in the edit form, that is raised when the user saves the customer information. If the property "CreateNew" that comes along with the custom EventArgs is true, then the child form creates a new form for this. Here is the code:
private void edit_Save(object sender, Edit.SaveEventArgs e) { if (e.CreateNew) new(); }
It works fine, but after saving and getting the new screen, the previous form is still on the screen and only closes when I close the second one - and it goes on and on until I stop using this function. I believe this happens because the function is still on (edit_Save). How can I prevent that, with simplicity, please?
Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: William Wisnieski |
last post by:
Hello Everyone,
Access 2000
I have a main form with a continuous subform. On the main form I have a
text field called . It gets populated based on what the user
selects in a field on the...
|
by: S. van Beek |
last post by:
Dear reader,
I have a strange situation.
In a Form with a list box to search for a record in the form it self. The
field in the list box is also available in the form. On an other...
|
by: Peter Oliphant |
last post by:
I now have graphics being drawn in the Paint event of my form (yeah, and
it's very cool). Problem was that it only updated any changes to these
graphics when Paint was called.
So, I then made it...
|
by: Jim Little |
last post by:
Hello,
I'm driving myself crazy either because I'm missing something about ASP.NET,
or what I'm trying to do simply can't be done.
First, I am not using session variables to track state. My...
|
by: Adda |
last post by:
If I cycle through the MdiChildActivate event of the
parent form I can read text in a textbox on the child
mdiform --
console.writeline(Me.ActiveMdiChild.Controls(1).Text)
But if I have a sub...
|
by: Br |
last post by:
First issue:
When using ADPs you no longer have the ability to issue a me.refresh to
save the current record on a form (the me.refresh does a requery in an
ADP).
We usually do this before...
|
by: Robert |
last post by:
I am trying to give the user dynamic search capabilities to select
almost any record in the database from criteria they select. Everything
seems to work except when I open the display form to...
|
by: martin1 |
last post by:
All,
is there window form refresh property? I try to set up window form refresh
per minute. Thanks
|
by: tomlebold |
last post by:
Having problems displaying query results from combo boxes on a sub
form, which is on the same form that is used to select criteria.
This has always worked form me when displaying query results on...
|
by: romerve |
last post by:
Hello; i am having some problems trying to get a form that has a
datagridview to refresh after a new record is created.
I have a MDI container and menu form and add new record form; the menu...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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...
|
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...
|
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,...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
| |