473,666 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cancel tab control page-change

I have a tabbed ap, and I want to provide a message and give the user a
chance to change
there mind if they try to change tab pages in the middle of an update
(otherwise just cancel the update and allow the change.) I thought the
TabPage.Validat ing event would be the thing, and as long as buttons and tab
page changes are done by mouse clicks, it seems to work fine. But if I use a
hot key to press "Cancel" or "Save", it seems to raise the Validating event
on the tab page, and then the message is stupid and annoying. Event looks
like this:

// This works fine as long as you use the mouse to click the buttons, but
// if hotkeys are used, it gets called when it shouldn't
private void tabSetup_Valida ting
(object sender, System.Componen tModel.CancelEv entArgs e)
{
if ( AddUpdateMode )
{
DialogResult result = MessageBox.Show (
"You may lose unsaved changes. Continue anyway?",
"Canceling Add/Update",
System.Windows. Forms.MessageBo xButtons.OKCanc el);
if (result == DialogResult.Ca ncel)
e.Cancel = true;
}
}

1) Why would using hot-keys to press a button trigger the TabPage's
Validating event when clicking the button with the mouse doesn't?

2) Any suggestions for how to make it work as I want... only pop up this
message if we're actually leaving the tab page, and actually cancel the
action (don't leave) if the "Cancel" button is chosen.
_______________ _______________ _______________ _______________ __
Roydan Enterprises Ltd
602 North 9th Street
Manitowoc, WI 54220-3924
Nov 16 '05 #1
0 2113

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
3925
by: Hautzendorfer | last post by:
Hello, I'm currently working on some printing stuff: I have to print out several .xml files using a stylesheet. Therefor I choose the Internetexplorer PlugIn via SHDocVW. My problem: After sending the print command via ExecWB for the first .xml document either the preview or the printer selection window occurs (depending on the passed parameter). This behaviour is ok.
0
5417
by: PeacError | last post by:
Using Microsoft Visual Studio .NET 2003, Visual C# .NET 1.1: I apologize if this question has been addressed elsewhere, but I could not find a reference to it in the search engine for this board. I have a form that contains a ListView and a GroupBox control. The GroupBox control itself contains several TextBox Controls. I have Validating and Validated event handlers set for the GroupBox control, and a SelectedIndexChanged event...
3
3695
by: news.public.microsoft.com | last post by:
Hi everyone, I have a VB.NET web form with some field validators and Save and Cancel buttons. What I want to do is on the Cancel button On_Click event, Response.Redirect to another page. The problem is that the client-side validation occurs before even reaching the event for the Cancel button. I've tried some ways to disable only the client-side validation, but I find it a poor design that you can't have a command button bypass the...
2
5345
by: wiewiek | last post by:
Is there a way to go back to the previous page when a button (Cancel button) is hot? It's an ASP control. Thanks
10
6007
by: Andrew | last post by:
Hi, I have a messagebox that pops up due to an event. I did it in javascript. ie. alert("Time's up. Assessment Ended"); I want to capture the OK and Cancel events of this alert messagebox. My code is in C#/ASP.NET. TIA. Andrew.
14
2620
by: clintonG | last post by:
This is an appeal for peer support sent to Microsoft as will be noted in closing. The Login control does not include a Cancel button. The only option is to convert the Login control to a template which is not such a bad thing in itself but it means all other controls in the application must also be converted to templates to maintain a consistent UI. So much for writing 70% less code when foolish morons release a control with no cancel...
1
6713
by: David Veeneman | last post by:
Does anyone knmow why an asynchronous worker method would crash if the e.Cancel method is set to true, but not otherwise? I'm working on a demo app with an asynchronous call, using the .NET 2.0 BackgroundWorker component. The app works fine if I let the worker method proceed to completion. But if I cancel the worker method, it crashes. Specifically, if I set the DoWorkEventArgs.Cancel property to true, the worker thread crashes at the...
2
1466
by: Matt | last post by:
I have found a scenario where I would like to cancel the RedirectFromLoginPage. If a user is authenticated in my web application then they manually enter a URL to a valid web page but do not have access they are redirected back to the login page, the only problem is now when they login it redirects them back to the manually entered URL which they do not have access which then flips them back to the login page. How can I cancel the...
1
3759
by: Matt | last post by:
I have a CreateUserWizard control on my registraion page and it works fine. I added the information in the CancelButtonType="Button", CancelButtonText="Cancel" and CancelDestinationPageURL="~/Default.aspx" but after setting all of this the Cancel button is not visible. How do I make the cancel button visible and active in the CreateUserWizard control? This seems so easy but I can't find anything in any documentation about having to do...
1
1593
by: Ganesh | last post by:
Hi There, I've a validation control in my page, In some cases i don't want to check the validation like when users click cancel, i'l take the page to home page. But it checks always validation. How can i ignore the validation when i click cancel Thanks Ganesh
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8869
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
8781
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
8639
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...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
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
4198
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...
0
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1775
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.