473,405 Members | 2,338 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,405 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 1272
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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...

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.