473,626 Members | 3,304 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

writing custom event for minimise, restore and close buttons

I have an example of code that allows and application to minise to the
notification tray but how can I override the minimise and close buttons to
ensure they always go back to the notify tray instead of closing the
application or minimising the the taskbar?

I am sure this must be simple I just can't find any information about it.
Mar 6 '06 #1
5 2071
smarty wrote:
I have an example of code that allows and application to minise to the
notification tray but how can I override the minimise and close buttons to
ensure they always go back to the notify tray instead of closing the
application or minimising the the taskbar?

I am sure this must be simple I just can't find any information about it.

why dont you check the window state in form resize event, if the window
state is minimized then write code to send your application to the
notification area.
regards
Vilsad
Mar 6 '06 #2
Thanks for the replay. I have used the resize event and this works fine for
minimising to the task tray but not sure how to override the X close event to
minimise to task tray.

Any ideas?
"Vilsad" wrote:
smarty wrote:
I have an example of code that allows and application to minise to the
notification tray but how can I override the minimise and close buttons to
ensure they always go back to the notify tray instead of closing the
application or minimising the the taskbar?

I am sure this must be simple I just can't find any information about it.

why dont you check the window state in form resize event, if the window
state is minimized then write code to send your application to the
notification area.
regards
Vilsad

Mar 6 '06 #3
smarty wrote:
Thanks for the replay. I have used the resize event and this works fine for
minimising to the task tray but not sure how to override the X close event to
minimise to task tray.

Any ideas?
"Vilsad" wrote:

smarty wrote:
I have an example of code that allows and application to minise to the
notificati on tray but how can I override the minimise and close buttons to
ensure they always go back to the notify tray instead of closing the
applicatio n or minimising the the taskbar?

I am sure this must be simple I just can't find any information about it.


why dont you check the window state in form resize event, if the window
state is minimized then write code to send your application to the
notificatio n area.
regards
Vilsad

you can use the formclosing event to override the closing of your
window, use e.cancel to cancel the closing and use your code to redirect
the window to the notification area

regards
Vilsad
Mar 6 '06 #4

you can use the formclosing event to override the closing of your
window, use e.cancel to cancel the closing and use your code to redirect
the window to the notification area

regards
Vilsad
Mar 6 '06 #5
Hi Smarty,

Thanks for your posting!
"but not sure how to override the X close event to minimise to task tray."


Overriding the form_onclosing method in VB.NET likes below:
Protected Overrides Sub OnClosing(ByVal e As
System.Componen tModel.CancelEv entArgs)
e.Cancel = True
Me.Hide()
MyBase.OnClosin g(e)
End Sub

Actually, if you want to implement minimize to tray, there is an
appropriate article demonstrates how to approach this:
http://www.pixvillage.com/blogs/devb...03/26/174.aspx

Unfortunately, the article is for VB.NET version. So, if you have any
concerns or issues, please feel you free to let me know. It's my pleasure
to be a future assistance!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
=============== =============== =============== =========
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were
updated on February 14, 2006. Please complete a re-registration process
by entering the secure code mmpng06 when prompted. Once you have
entered the secure code mmpng06, you will be able to update your profile
and access the partner newsgroups.
=============== =============== =============== =========
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== =========

Mar 7 '06 #6

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

Similar topics

4
1910
by: Rudy | last post by:
Hello all, I'm sure there is, just can't figure it out. I have the RGB code and the color number. But the color doesn't exsist in Visual studio.net. Can I add this color to the system pallet it self, so I can add the custom color to fonts? I need to match as close as possible to the color I was given. Thanks Rudy
29
9765
by: lori3laz | last post by:
How do you disable the right click>view source option on web pages so people can't view your coding and copy it? What's the html I need to include in my website to utilize this feature? Thank you.
9
15848
by: Susan Bricker | last post by:
I am currently using the OnDirty event of a Form to detect whether any fields have been modified. I set a boolean variable. Then, if the Close button is clicked before the Save button, I can put up a message on the screen that will tell the user that "Data has been changed, do you wish to Save the record before Closing this window?" I think I've just discovered this only works if the record that is being displayed/modified it not a...
1
2895
by: Sumit | last post by:
Hi all, I have an MDI form in which i open some other forms. I dont want the Control Box (having minimize, restore/maximize and close button) Even though I have set the controlbox property of my child forms as false & the respective minimize & maximize box property to false, i get the control box with restore button as enabled (when i dock my child form in the MDI form with dockstyle as fill) which restores the
16
2197
by: iwdu15 | last post by:
how can i open a file i saved and place the info into different text boxes?
19
4904
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the exception of custom Collection Classes. Background: I'm developing an A2K .mdb to be deployed as an .mde at my current job-site. It has several custom controls which utilize custom classes to wrap built-in controls, and add additional functionality....
7
9069
by: Marcolino | last post by:
Hi all, I need to add a custom button to title bar on a form in addition of a standard button. (Minimize/Maximize, close etc.) I need also to handle OnClick event of this button. I looked around google but i'm not able to find any example that can help me. Many thanks in advance for your help. Marco
1
1763
by: billsahiker | last post by:
I need help diagnosing an error that occurs on the web server where my web site is hosted, but it does not occur when I run it under VS2005. I have an errors.aspx page that captures unhandled application errors. The error I get from Server.GetLastError() is: "The server cannot fulfill your request." Scenario: I developed a composite web server control in C# . It is on a web page in an ASP project I developed with VB as the language....
2
2802
by: Peter | last post by:
Hi I've discovered a bizarre Windows Forms (VB.NET) behavior that is resulting in a Form not being able to be moved. To reproduce this: 1) Create yourself a new Windows Application in Visual Studio 2005. 2) A project will be created with one Form (Form 1). Don't add any code to the project. 3) Run the project and confirm that Form 1 is displayed and you can drag the Form around your screen by clicking and dragging the Form's
0
8269
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
8711
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
8642
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...
1
8368
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,...
0
8512
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
7203
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
5576
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
4094
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
2630
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 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.