Windows Forms Topics include: windows forms, controls, components and designers

Go Back  Xtreme .NET Talk > .NET > Windows Forms > DefInstance


Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2002, 02:51 PM
afrinspray
Guest
 
Posts: n/a
Default DefInstance

Do you guys think it's good practice to remove the DefInstance functions in an upgraded VB net program? Why did Microsoft remove the ability to access "default forms"?
Reply With Quote
  #2  
Old 07-26-2002, 03:48 PM
Derek Stone's Avatar
Derek Stone Derek Stone is offline
Exalted One

Preferred language:
C#
 
Join Date: Nov 2002
Location: Rhode Island, USA
Posts: 1,877
Derek Stone is on a distinguished road
Default

They had no choice but to remove them. .NET doesn't support them. Simple as that.

And yes, if you have the time to make the proper changes I would remove the DefInstance functions, although they shouldn't cause any problems as they stand.
__________________
Posting Guidelines
Reply With Quote
  #3  
Old 07-28-2002, 04:34 AM
divil's Avatar
divil divil is offline
Ultimate Contributor
 
Join Date: Nov 2002
Location: England
Posts: 2,747
divil is on a distinguished road
Default

Microsoft didn't remove the ability per se, you just have to understand that in VB.NET you have Classes, and you have Structures. There is no special case for forms as there was previously. A "form" is just a class with some pre-written code.

You can't just get a default instance of a class, that's what Shared members are for. I hope that makes it clearer.
__________________
MVP, Visual Developer - .NET

Now you see why evil will always triumph - because good is dumb.

My free .NET Windows Forms Controls and Articles
Reply With Quote
  #4  
Old 07-30-2002, 01:57 PM
afrinspray
Guest
 
Posts: n/a
Default

Is it then also bad practice to use global variables in Modules?
Reply With Quote
  #5  
Old 07-30-2002, 02:31 PM
Derek Stone's Avatar
Derek Stone Derek Stone is offline
Exalted One

Preferred language:
C#
 
Join Date: Nov 2002
Location: Rhode Island, USA
Posts: 1,877
Derek Stone is on a distinguished road
Default

There are no modules in .NET.

(see below)
__________________
Posting Guidelines

Last edited by Derek Stone; 07-30-2002 at 05:56 PM.
Reply With Quote
  #6  
Old 07-30-2002, 05:29 PM
afrinspray
Guest
 
Posts: n/a
Default

Yes there are modules in .NET. I'm using some right now!?
Reply With Quote
  #7  
Old 07-30-2002, 05:54 PM
Derek Stone's Avatar
Derek Stone Derek Stone is offline
Exalted One

Preferred language:
C#
 
Join Date: Nov 2002
Location: Rhode Island, USA
Posts: 1,877
Derek Stone is on a distinguished road
Default

I stand corrected. My apologies.

And yes, it is a bad practice if you want to adhere to strict OOP standards.
__________________
Posting Guidelines
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Advertisement:

Powered by liquidweb