PDA

Click to See Complete Forum and Search --> : Why not every form


AndersThornell
Nov 4th, 2002, 04:56 PM
Hello! I have a problem with VB. Net and a project that I am converting from VB6. I have a few modal forms. Thay are open as, for example:

'********************
Dim objfrm1 As frm1

objfrm1 = New frm1()
objfrm1.ShowDialog()
'********************

Every form have a event for Load, that does (or should do) some things every time the form is opened. The declaration for the event look like this:

'********************
Public Sub frm1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
'********************

My problem is that some of the forms doesn't go into the event, or what you now should call it, so the things that are supposed to occur don't occur.

I have compare the forms that works with the one that doesn't work, but I can't find any differences between them.

Does anyone know what the problem is and what I should do to do so that the Load event occur for all forms.

Very grateful for all help!

/Anders Thornell

Edneeis
Nov 4th, 2002, 05:40 PM
Post the code for both and we'll try to help.

AndersThornell
Nov 5th, 2002, 04:47 AM
Ok, here are the code for two of the forms. frmAlternativ is the one that doesn't work, and frmFiler_Skapa is the one that works perfectly. I attach the forms *.vb-fiels in a zip-archive.

/Anders

Hu Flung Dung
Nov 5th, 2002, 11:38 AM
Originally posted by AndersThornell
Ok, here are the code for two of the forms. frmAlternativ is the one that doesn't work, and frmFiler_Skapa is the one that works perfectly. I attach the forms *.vb-fiels in a zip-archive.

/Anders

As soon as I load these forms into VS.NET, the Task List shows at least a million errors in frmFiler_Skapa (it even says 'Maximum number of errors has been exceeded.'). All of the exceptions have to do with something not being declared.

My guess is that these forms are using at least 1 other module. I cannot get them to work until you upload that too.

AndersThornell
Nov 5th, 2002, 04:51 PM
Sorry, my mistake. I have done a new zip-file with four forms from a much bigger project. Two of the forms if working perfectly and the two others have the problem i described in my first message. The two forms that I have problem with are the forms that are open when you click either "Alternativ" or "Kalkylatorn" in the menu in the first form.

You will notice my problem if you load one of this form and you find a star "*" in front of some labels, if there are any stars, the form does not have the problem I wan't to solve.

/Anders

AndersThornell
Nov 6th, 2002, 05:25 PM
Isn't there anyone who can help me solve this problem? I don't know what to do about it anymore!

/Anders

Edneeis
Nov 6th, 2002, 06:28 PM
That is very wierd but I found the cause:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q318386

You should avoid using activeX controls wherever possible in .net for reasons like this. Hopefully one of those fixes will help.

Overriding the WNDPRC worked and is nice and easy.

AndersThornell
Nov 7th, 2002, 06:41 AM
Thank you so muck, I am going to try this as soon as possible.

I never thought about that there could be any problem with the activeX controls, because I have deactivate one of the controls in one of the forms and I have never used it, so I never notice that the control is there.

Thanks again!

/Anders