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

Canceling Window Creation

Hi,

If window creation cannot continue how is it cancelled within
an Load event handler? Setting DialogResult to Cancel
does nothing and Close() is not allowed. The form is shown
modelessly so returning a value directly to the parent is
meaningless.

I am using .NET 1.1.

Thanks,
Gary
Oct 19 '05 #1
1 1268
You can't really close the form in the Load event but I've find this pattern
works. The form will start fully transparent, then after you've decided that
you want to show it you set the Opacity back to 100 and do your normal code.
If you decide not to show the form then use BeginInvoke call Close outside
the Load event.

Me.Opacity = 0
If <condition to close form> Then
Me.BeginInvoke(New MethodInvoker(Me.Close), Nothing)
Else
Me.Opacity = 100 ';
' regular form load code here
End If

--
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada
http://msmvps.com/windsor/
"Gary Brown" <ga********@charter.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

If window creation cannot continue how is it cancelled within
an Load event handler? Setting DialogResult to Cancel
does nothing and Close() is not allowed. The form is shown
modelessly so returning a value directly to the parent is
meaningless.

I am using .NET 1.1.

Thanks,
Gary

Oct 20 '05 #2

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

Similar topics

13
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
4
by: Phillip Parr | last post by:
Hello, I have a nice system where someone clicks on a picture to show the full version. This pops up in a window.open box. It works great, the only problem is that if the user clicks a second...
0
by: Gary Brown | last post by:
Hi, If window creation cannot continue how is it cancelled within an Load event handler? Setting DialogResult to Cancel does nothing and Close() is not allowed. The form is shown modelessly...
11
by: Tore Halset | last post by:
Hello. I am trying to port an old java application from MS SQL Server to PostgreSQL running on Mac OS X. I have access to the java source code and can make modifications. I have tried with...
1
by: anagai | last post by:
hi I would like to cancel a settimout from happening. I dont want it to execute the expression at all. clearTimeout just cancels the delay but executes the expression anyway. I want to cancel...
2
by: Robert Degen | last post by:
Hello, I got a little problem. Seems very simple: * I want to open a popup window * Popup-window uses data from its father window. BUT a parent.window does NOT point to the real parents...
0
by: thomas.dunn | last post by:
Hello, I am writing a web setup project that acts as a patch that replaces some resource files of an asp.net application that has previously been installed by a web setup installer. What I want...
1
by: writebrent | last post by:
The goal is the following: 1) On a mouseover, create & show a div; 2) If the user hovers over the div, keep it visible, otherwise remove and destroy. I haven't been able to find examples, so...
0
by: rcarmich | last post by:
I am having an issue canceling a beginReceive call on a timeout. For example, the following function: public int ReadBytes(Socket theSock, byte arr, int startByte, int length, int timeout) {...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: 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
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...

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.