473,322 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Form.ControlBox and Alt/F4

I have a Dialog type form that starts a worker thread,
allows the thread to update its progess and provides a
Cancel button. Following advice from Chad Meyers in a
recent posting, the worker thread updates the dialog by
calling Invoke which runs the UI update method on the UI
thread. This works nicely. (Thanks Chad)

However, if I close the dialog using the form close button
([x] top right hand corner) I get an
ObjectDisposedException when calling Invoke on the Dialog
form. So I remove the Form.ControlBox, attempting to
force the user to cancel and/or close the dialog using my
buttons. This fixes the [x] problem, but I'm still able to
close the form using Alt/F4. In this case, the Form
closes (the window disappears and the Closing event
fires), but Dispose() is not called. My worker thread
continues to run and call Invoke, apparently without
problem.

I can easily signal the worker thread to quit from the
Closing event, but I'm nervous since I don't really
understand what's going on. The documentation for
Form.ControlBox states that "If your form does not display
a control box, the form is not able to close using the
ALT+F4 keyboard combination."

My form seems to be closing but not disposing. What's
going on?

Many thanks

Nov 15 '05 #1
0 3781

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

Similar topics

1
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...
3
by: Dan M | last post by:
Hi, Upgraded a 1.0 project to 1.1. Had a form that I opened with ShowDialog. ControlBox set to false at designtime and I set caption in the form load (me.text="my title"). This worked fine in...
13
by: Sylo | last post by:
Hi, I'm french and I don't find the answer at my question. You are my last chance and sorry for my english... I'm in VB .NET 2002 I have a MDI form with the property ControlBox at FALSE. When...
0
by: Sakharam Phapale | last post by:
Hi All, I am developing an application which works similar to MS WORD. I have a main form which acts as MDI container and I am using a third party menu control so that it looks like XP style...
6
by: Dennis | last post by:
I have a form that I show as a Dialog but before I show it, I reset the form's location. I have the StartPostion set to Manual. If I have ControlBox set to True, all works ok but if I set the...
7
by: Miro | last post by:
I can use the property of the Form to remove the "x" from the top of the form. Is there a way in VB to leave the X there but program something so you cannot close the form? Or like an ONCLOSE...
3
by: Alan T | last post by:
I want to put an icon on a Windows Form top left hand corner but would like to hide the maximize and close box on the top right hand corner. Can I do that?
7
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I've noticed that a form will cover the taskbar when it is maximized if its ControlBox property is set to false (even if the "Keep the taskbar on top of other windows" option is selected). You can...
2
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All, I am trying to determine if the user clicked the "x" close button within the controlbox of the form (top right corner - next to minimize and maximize buttons). I am using the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.