473,506 Members | 17,266 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 2059
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
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

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.ComponentModel.CancelEventArgs)
e.Cancel = True
Me.Hide()
MyBase.OnClosing(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
1901
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...
29
9746
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...
9
15839
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...
1
2889
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...
16
2184
by: iwdu15 | last post by:
how can i open a file i saved and place the info into different text boxes?
19
4891
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...
7
9061
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...
1
1761
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...
2
2797
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...
0
7220
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
7371
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...
1
7023
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...
0
7479
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...
0
5617
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,...
1
5037
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...
0
1534
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 ...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
410
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...

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.