473,322 Members | 1,431 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.

Closing a modal dialog programatically

Dear all,

Within a C# application, I need to start a background thread that:

1) watches for a dialog to appear
[The dialog will be opened using MessageBox.Show()]
2) finds a button labeled "OK" on the dialog
3) pushes the button
4) terminates

Anybody have any ideas on how to watch for a dialog from a background thread?

Thanks and regards,

Randy
Nov 16 '05 #1
1 4414
Hi Randy,

If you have no reference to this modal form or you have no
handle then there's no direct way to achieve this.

MessageBox doesn't show as an Form.ActiveForm or
evens as an Owned form.

I can only recommend to write your own Dialog with this
functionality.

Regards

Marcin
Dear all,

Within a C# application, I need to start a background thread that:

1) watches for a dialog to appear
[The dialog will be opened using MessageBox.Show()]
2) finds a button labeled "OK" on the dialog
3) pushes the button
4) terminates

Anybody have any ideas on how to watch for a dialog from a background thread?

Thanks and regards,

Randy

Nov 16 '05 #2

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

Similar topics

2
by: Gilles T. | last post by:
Hi, How I can refresh a modal dialog in asp.net? I open a modal dialog in first with a dropdownlist. To add a element in my dropdownlist (table), I open a second modal dialog to ask element and...
0
by: Andrew | last post by:
I get a Null Reference Exception if I close a modeless form (that is, a form displayed using Show()) when a selection is made from a ComboxBox. If the form is modal (displayed using ShowDialog())...
3
by: Andrew | last post by:
I get a Null Reference Exception if I close a non-modal dialog (that is, a form opened with Show()) when a selection is made from a ComboBox. The error message refers to Unsafe Native Methods, but...
6
by: sramruttun | last post by:
hi I open a pop up window using window.showModalDialog. How can I close the parent window after the pop up appears ?
10
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a...
4
by: rdemyan | last post by:
I'm using code from the following web page to open the API Browse Folder dialog http://www.mvps.org/access/api/api0002.htm It all works fine. But if the dialog box is open and the user closes...
23
by: Chukkalove | last post by:
Im sorry, I dont know the correct description for a hierarchy of parent and child forms. I have a main form that opens a child form modally. This child form in turn opens it's own child form...
3
by: Mike Hofer | last post by:
Okay, here's the situation: we want to be able to display ASPX pages in an UpdatePanel. The reasons for this are performance related. The site in development uses *lots* of modal popups from some...
0
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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: 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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.