473,395 Members | 1,457 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,395 software developers and data experts.

Inability to trap form.show event

I have a rather simple form that takes a user name and password,
validates it, and loads another form. All this is done in the click
event for the one and only button on the form. Everything works fine
except that after the event is finished the form breaks because of an
unhandled system.argument exception, and highlights the form class
declaration. This only happens when I do the form.show command in the
click event. When I comment it out I do not get the exception. The
strange thing is that I get the exception even when I use a try - catch
block. I know it is the form.show() that is the problem as commenting
that out, regardless of the try-catch block, prevents the exception. If
I can figure out what exactly is causing the exception I could probably
figure this out on my own. I know that the try-catch system is working
as it has caught other problems.

Marc
Apr 10 '06 #1
4 1326
Marc the Demi-Programmer wrote:
I have a rather simple form that takes a user name and password,
validates it, and loads another form. All this is done in the click
event for the one and only button on the form. Everything works fine
except that after the event is finished the form breaks because of an
unhandled system.argument exception, and highlights the form class
declaration. This only happens when I do the form.show command in the
click event. When I comment it out I do not get the exception. The
strange thing is that I get the exception even when I use a try - catch
block. I know it is the form.show() that is the problem as commenting
that out, regardless of the try-catch block, prevents the exception. If
I can figure out what exactly is causing the exception I could probably
figure this out on my own. I know that the try-catch system is working
as it has caught other problems.

Marc


Something I neglected to mention is that when I step through with the
debugger it seems to process the show() command appropriately. However,
I still get the exception if and only if the show() command is used.

Marc
Apr 10 '06 #2
Create two separate new forms, and call one from the other. Then compare why
this one works, and yours doesn't

Jeff

"Marc the Demi-Programmer" <no@address> wrote in message
news:uc**************@TK2MSFTNGP03.phx.gbl...
I have a rather simple form that takes a user name and password,
validates it, and loads another form. All this is done in the click
event for the one and only button on the form. Everything works fine
except that after the event is finished the form breaks because of an
unhandled system.argument exception, and highlights the form class
declaration. This only happens when I do the form.show command in the
click event. When I comment it out I do not get the exception. The
strange thing is that I get the exception even when I use a try - catch
block. I know it is the form.show() that is the problem as commenting
that out, regardless of the try-catch block, prevents the exception. If
I can figure out what exactly is causing the exception I could probably
figure this out on my own. I know that the try-catch system is working
as it has caught other problems.

Marc

Apr 10 '06 #3
It would be helpful if you showed the code and the full text of the
exception including a stack trace. It will be easier to determine what
is happening.

Apr 11 '06 #4
Chris Dunaway wrote:
It would be helpful if you showed the code and the full text of the
exception including a stack trace. It will be easier to determine what
is happening.


I figured out kind of what was going on. The exception was happening in
a custom control in the form being called. Once I managed to figure out
how to do the debugging in the two projects I managed to fix the issue.

I do appreciate all of your help, not just the person on whose post I am
replying.

Marc
Apr 11 '06 #5

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

Similar topics

2
by: Fred Sawtelle | last post by:
I'm trying to trap the Enter key in any of the key events (keypress, keydown, keyup) of the Windows .Net combobox control. Try as I might, I cannot get the event to respond to an Enter key press;...
5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
3
by: Gavin | last post by:
Hi All I have a project that has 2 forms, the main form displays various sql data items and the second form is for editing / updating 1 particular table. I would like to refresh a dataset on...
4
by: Henry Stockbridge | last post by:
Hi, I am using Access 2003 to automate an Excel workbook, but after the code completes Excel does not quit (at least it is still listed in Task Manager --Processes.) I have set a reference to...
1
by: JDeats | last post by:
If you create a new C# Windows Application project in Visual Studio.NET 2003 or 2005 and proceed to. 1. Make default form size 800x600 2. Drop a CheckBoxList control and dock it to the left 3....
3
by: mtczx232 | last post by:
I have TabControls that Hold Forms on his TabPges (this make me easy to give ability to Designing each form in his IDE window). When form x is in middle of Edit Data Mode, I going to prevent:...
3
by: Z.K. | last post by:
I have a problem trapping the return key. I thought if I added the forms keydown event handler that this would do what I want. It did not even go into the keydown event handler when I pressed...
4
by: EManning | last post by:
Using A2003. I've got an FE with a main form with a subform. The subform is a mixture of bound and unbound fields. The main form is unbound and all it has on it is a combobox to choose a...
2
by: EManning | last post by:
I posted a question on 5/5/08 asking how to trap an error caused by multiple users trying to access the same patient. Here's what I posted: "Using A2003. I've got an FE with a main form with a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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...

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.