Visual Studio .Net crashes when open Inherited form in Designer

M

MNF

I've created a new Windows form and then another form inhereted from
the first one.
When I try to open Inherited form in Designer View, Visual Studio .Net
2003 silently closes my solution.
I even was not able to re-open solution (VS closes in the process of
restoring previously open windows) until I delete .SUO file.

Did anyone have the same problem in the past?

Michael
 
N

Nick Carter

Michael,

This is probably a red herring but you could try deleting the
<application>.projdata file in the obj\Debug directory. That has solved
problems for me in the past.

Nick
 
M

MNF

Nick,
Thanks for your reply.

I solved the mistery. It was actually my own code that was executed by
VS.
In the base class I have Form_Load event handler

Protected Sub BaseForm_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Some Code
If bRet = False Then 'check if previous code was unsuccessful
SendKeys.Send("%{F4}") 'Alt+F4 to close Modal Form in Load
event
Exit Sub
End If
End Sub

When I open Inherited form in Designer View, Visual Studio .Net loads
base form and BaseForm_Load function was executed(I didn't expect
this).
Sending Alt+F4 keys closes current window , which in this keys is
Visual Studio.
I solved the problem by adding the line
If Me.DesignMode = True Then Exit Sub
I also will change the way of closing Modal Form in Load event to more
safe.

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top