I know this sounds ridiculous but I am having problems when exiting/sighing
out of my application.
I have two forms, Login and Main. On Main form, I have two buttons, Sign
Out and Exit. These two buttons and the close button (X) should ask user to
confirm exiting or signing out, then if Yes, they should write log file and
then do:
- When I click exit, I should close both, main and login form.
- when I click Sign out, I should close only main and show login form.
That is simple, but the problem starts when I want my X (close button on
main form, upper right corner) to behave the same way as my Exit button.
Any help will be appreciated
--
Dino Buljubasic
Software Developer http://rivusglobal.com 4 4186
"Dino M. Buljubasic" <di************ *@rivusglobal.c om> wrote in
news:%q******** *********@news1 .telusplanet.ne t: That is simple, but the problem starts when I want my X (close button on main form, upper right corner) to behave the same way as my Exit button.
I think this should work. Basically you handle the Form.Closing event:
Public Sub test(ByVal sender As Object, ByVal e As
System.Componen tModel.CancelEv entArgs) Handles MyBase.Closing
'Execute a Sub
MsgBox("The Form is Closing!")
'You can stop Form.Close from closing by doing this
e.Cancel = True
End Sub
There's some stuff in the docs about not putting validation code in the
closing method... I haven't read through it carefully so I don't know
what problems this may cause. http://msdn.microsoft.com/library/de...l=/library/en-
us/cpref/html/frlrfsystemwind owsformsformcla ssclosingtopic. asp
--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying. http://members.ebay.com/aboutme/coolspot18/
Hi Lucas, Public Sub test(ByVal sender As Object, ByVal e As System.Componen tModel.CancelEv entArgs) Handles MyBase.Closing
'Execute a Sub MsgBox("The Form is Closing!")
'You can stop Form.Close from closing by doing this e.Cancel = True End Sub
Looks like the good old days, closing programs with ctrl alt del
:-)
(I know you can put an if before it in a real program).
Cor
Hello,
"Dino M. Buljubasic" <di************ *@rivusglobal.c om> schrieb: - When I click exit, I should close both, main and login form. - when I click Sign out, I should close only main and show login form.
That is simple, but the problem starts when I want my X (close button on main form, upper right corner) to behave the same way as my Exit button.
\\\
Private Sub Form1_Closing( _
ByVal sender As Object, _
ByVal e As System.Componen tModel.CancelEv entArgs _
) Handles MyBase.Closing
If ... Then
e.Cancel = True ' Cancel closing process.
End If
End Sub
///
--
Herfried K. Wagner
MVP · VB Classic, VB.NET http://www.mvps.org/dotnet
Is there a way for me inside the form.closing event to detect which button
is calling the form.close?
That way, I could distinguish btw my Sign Out, Exit and X buttons
Thank you for your help
--
Dino Buljubasic
Software Developer http://rivusglobal.com
"Herfried K. Wagner [MVP]" <hi*******@m.ac tivevb.de> wrote in message
news:Or******** ******@TK2MSFTN GP10.phx.gbl... Hello,
"Dino M. Buljubasic" <di************ *@rivusglobal.c om> schrieb: - When I click exit, I should close both, main and login form. - when I click Sign out, I should close only main and show login form.
That is simple, but the problem starts when I want my X (close button on main form, upper right corner) to behave the same way as my Exit button.
\\\ Private Sub Form1_Closing( _ ByVal sender As Object, _ ByVal e As System.Componen tModel.CancelEv entArgs _ ) Handles MyBase.Closing If ... Then e.Cancel = True ' Cancel closing process. End If End Sub ///
-- Herfried K. Wagner MVP · VB Classic, VB.NET http://www.mvps.org/dotnet
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Martin |
last post by:
I have a couple of questions around code signing with MS technology:
1. Is there a way to transfer the generated strong name signing private key
directly to a smartcard (or generate it on the smart card), without the
unsecure intermediate storage to the filesystem using sn -k and sn -i?
2. What is the format of the key files produced by sn -k and sn -p?
3. Is there a way to generate a PKCS#10 format certificate request from the
sn -p...
|
by: Davey |
last post by:
I am planning on developing an application which will involve skills that I
have very little experience of - therefore I would appreciate comments on my
initial design thoughts.
Overview on system:
I'm not going to divulge the exact aims of the application but the purpose
of it is to allow multiple client applications to retrieve data from a
database (on a db server) and feed this data into another Windows
|
by: Todd Richardson |
last post by:
Two questions. We would like to have users complete
ASP.NET web forms for submission. Once these are
completed I would like to generate an XML document from
the form. The XML document should include the data and
the form so that the orginal document could be recreated
even if the submitting form is changed in the future.
I would also like to sign the XML document so that we can
provide proof that the xml document has not been...
|
by: Todd Matson |
last post by:
I have several database applications developed in Access 2000. Some of my
users have upgraded to Access 2003, and they get a warning every time they
open the application: "This file may not be safe if it contains code that
was intended to harm your computer."
I understand that there are two ways to avoid this message. One is to set
the security level on Access to low. The other is to sign the database with
a digital certificate, and ask...
|
by: AVL |
last post by:
Hi
I need some clarification on signing.
what does it mean--signing an assembly?
where is ti used? How is it used?
| |
by: =?Utf-8?B?SklNLkgu?= |
last post by:
Signing PDF on the web application
I have a web application that created PDF based on the information users
give in the site, how can I get this PDF be signed electronically, is there
any sample code I can use?
|
by: Ken |
last post by:
I have an application that uses SQL Server Express that I have
published with VB 2005. Not long ago I purchased a new computer and
loaded VB 2008. It would not let me publish my application with out a
signing certificate. I have tried to uncheck the requirement of the
signing certificate but when I attempt to publish I find it is checked
again. I can create a test certificate but I want to be able to give
my application away with out...
|
by: raylopez99 |
last post by:
Anybody use Strong Name Signing? I think this is used by default for
Resource files, which is one reason perhaps I can't get my resource
files to work (somehow the public key is messed up, perhaps since I've
installed so many versions of Visual Studio)
RL
http://msdn.microsoft.com/en-us/library/h4fa028b.aspx
Deployment in Visual Studio
|
by: BillE |
last post by:
<extreme frustration>
I have googled and read about this, but can't seem to get a grip on it.
Apparently I am being coerced into digitally signing applications. Is this
true? What if I don't want to?
The basic question is: If I click the "Create Test Certificate" button on
the Signing tab of the properties for my application so I can publish it,
what happens when I distribute the application?
|
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...
|
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,...
| |
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...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |