Solved

Remove DefInstance

Posted on 2004-03-29
3
316 Views
Last Modified: 2008-03-17
Hi,

Have converted over an application from Access to vb6 to Vb.net

In the upgrade from vb6 to Vb.net, the conversion tool created a property called "DefInstance".

This is used to reference a control in a form from outwith that form. (e.g. A Code Module)

Am getting issues with this DefInstance in Form initialization.

Does anybody know a way around using "DefInstance"

Thanks.
0
Comment
Question by:KBanner
3 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 125 total points
ID: 10703984
In VB6, forms were easily accessed as shared members (i.e. Form1.TextBox1).  In VB.NET, you need an instance of a variable in order to reference something on a form:

Dim frm As New Form1
frm.TextBox1

The DefInstance is the migration wizard's answer to overcoming this switch in paradigm.  You could remove it, but you would need something similar in its place.

Bob
0
 

Author Comment

by:KBanner
ID: 11072712
My sincere apologies,

Another escaped the net. Bob yet again helping people and nobody thanking him. Hope this helps
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question