|
-
Feb 29th, 2004, 03:42 PM
#1
Thread Starter
PowerPoster
Unexpected result (Resolved)
Hi,
While trying to identify a problem I have with a project, I happened, at a breakpoint, to try to print in the command window, the name of the current form.
I had created frmMain as an instance of fclsMain and to my surprise, the command window showed "fclsMain".
I expected it to show "frmMain".
Can anyone explain, please?
Last edited by taxes; Mar 1st, 2004 at 11:49 AM.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Feb 29th, 2004, 05:44 PM
#2
What did you use in the command window?
-
Feb 29th, 2004, 07:22 PM
#3
Thread Starter
PowerPoster
Hi,
"What did you use in the command window?"
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Feb 29th, 2004, 08:10 PM
#4
Is frmMain the variable name? Me.Name will return whatever is set as in the Name property.
-
Mar 1st, 2004, 04:07 AM
#5
Thread Starter
PowerPoster
Hi,
"Is frmMain the variable name? Me.Name will return whatever is set as in the Name property."
frmMain is the instance of fclsMain
Are you saying that frmName.Name will hold the same contents as fclsMain.Name? If so, why do I refer to objects in frmMain as, eg. "frmMain.txtOne" ?
Last edited by taxes; Mar 1st, 2004 at 04:13 AM.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Mar 1st, 2004, 11:05 AM
#6
If frmMain is an instance of fclsMain and fclsMain has the name set at designtime then frmMain will have the same name as what was set at designtime. This is because the things you set at designtime are executed in the constructor of the object which gets called for every instance. So unless you change the name property at runtime then every instance of fclsMain will have the same name. The name is just a property like any other and has no bearing on how you refer to the object.
-
Mar 1st, 2004, 11:49 AM
#7
Thread Starter
PowerPoster
Hi Edneeis,
Got it!
Many thanks.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
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
|