• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Can't find shape control in Vb .NET

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

InfamousHindu

Member
Joined
Dec 31, 2002
Location
gettysburg
I need to add a simple shape to my form, but I can't find the shape control in Vb .NET. I did some research around the internet and found out that microsoft removed it, so how do I add shapes to my form now? I am a extreme amature to Visual basic, just started to learn it 2 weeks ago, so keep it as simple as you can please.
 
I would recommend that you back up to VB6. It's much better than .Net. I use VB6 and intend to until M$ comes out with a decent replacement if they ever do. I dislike the .NET language and just about everything new about it. The solution of your problem is to use VB6 instead.
 
Hrm not exactly the best advice in my opinion. .Net is a company wide direction for microsoft, don't expect them to release some language that is comparable to vb6 down the road.

.Net is superior to vb6 in so many ways it takes books to just cover the improvements. Sure there is a learning curve to move from vb6 to .net, its basically as monumental of a change to the language as it was going from gw basic to the original visual basic. But for a person just starting out you won't care what has changed and what is new.

In answer to your question regarding shapes, I just figured I would paste a snippet of the .net documentation which tells you all the namespaces that deal with that:

The System.Drawing namespace provides access to GDI+ basic graphics functionality. More advanced functionality is provided in the System.Drawing.Drawing2D, System.Drawing.Imaging, and System.Drawing.Text namespaces.

Anyways you didn't lose any functionality, its just all contained in the CLR(common language runtime) now.
 
I'm not expecting Microsoft to go back to VB6 ways, but I do expect them to fix a few things in .NET, namely COM support. COM support is terrible in .NET. I don't like the language changes in .NET. Even if it is all in CLR instead of different DLL's, all it does is add more code to object declarations. Example:

VB6 Code for declaring an XML object:
Dim doc As New DOMDocument

VB.NET Code for the same thing:
Dim doc As New System.Xml.Document

VB6 Code for declaring a Form object:
Dim frm As Form

VB.NET Code for declaring a Form object:
Dim frm As System.Windows.Forms.Form

I admit, .NET does have a few nice language features, but I will always use the compiler that is easier to use. I don't use the Database features .NET is supposed to have either so that doesn't help. Also, .NET applications run slower and require the 24MB (I think) .NET framework DLL to run.

If you are trying to learn to program, I would recommend VB6 because of it uses simpler code and is easier to understand.
 
Heh first things first, no way that .net code performs slower than vb6 com code. Even experienced developers can write terrible code in vb6, because vb6 does too much for the developer, often causing undesired consequences. Too much of the inner workings of COM are obscured from the developer in vb6 and it can become a nightmare in a multithreaded environment if you do not know precisly the correct way to set the project properties and to declare your variables. I would say easily 9 out of 10 VB COM/ASP sites I have had to work on were written incorrectly, and the developers had no idea that just because you can write the same line of code 3 different ways that only 1 of them is actually correct. These are the exact types of issues that vb.net has made great strides towards eliminating.

As for being more wordy, well it does not have to be more wordy. In your example of the DOMDocument you failed to mention that you need to add a reference to that dll, which for all intents and purposes is the same as importing a namespace in vb.net. So if you import System.Windows.Forms then you can declare your form as just Form.

There is a significant learning curve in moving from vb6 to vb.net, but that doesn't make vb.net a bad language. On the contrary I think, I am rather happy that Microsoft was brave enough to make such a drastic change to vb.

For a developer starting fresh I think it would be truley silly to learn a language that most would be considered depricated. If you learn vb.net you have the added advantage of learning the clr, which will benefit you if you decide to try your hand at any other .net language. Now add on top of all that the fact that the visual studio .net IDE is light years ahead of the vb6 IDE and well I find it awfully hard to go back and work on vb6 stuff anymore ;)
 
Back