-
June 24th, 2014, 03:39 AM
#1
-
June 27th, 2014, 01:20 AM
#2
Re: Form Instantiation
Well as I see it you are making a copy of Form1. I would not expect the name to change, it is assigned in the original Form1 properties.
Always use [code][/code] tags when posting code.
-
June 27th, 2014, 02:47 AM
#3
Re: Form Instantiation
Originally Posted by DataMiser
Well as I see it you are making a copy of Form1. I would not expect the name to change, it is assigned in the original Form1 properties.
LOL! I have wracked my brains trying work out what was happening but your explanation was staring me in the face and I could not see it.
Apologies for wasting people's time ... I will go and find a hole to hide in ...
But the article on "auto instantiation" (no connection to me) is well worth reading as this is important but obscure
.
Last edited by wavering; June 27th, 2014 at 02:59 AM.
-
November 4th, 2014, 06:04 AM
#4
Re: Form Instantiation
On the subject of Auto-Instantiation (or, behavior as a function of the My.Forms object as Microsoft like to call it) I have just spent a couple of days trying to solve a problem. To be specific I had:
Code:
Friend frmOffice As New frmOffice
Public Sub Main()
...
frmOffice.Show() ' This reads values from the Registry and sets buttons in frmOffice
...
End Sub
Code:
Private Sub frmReception_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
...
blnMode = frmOffice.Rad01.Checked
...
End Sub
What I found was that although frmOffice was on display and the setting was clearly made as "True", blnMode was showing "False". After a lot of messing about it became apparent that there were TWO versions of frmOffice in existence. One auto instantiated by Microsoft (thanks for nothing) and one by me!
So, I got rid of "Friend frmOffice As New frmOffice" and suddenly it all worked as it should ...
MOPEKS - a freeware program that generates programs that use each other to solve problems. Is this the correct route to a genuinely intelligent machine?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|