Solved

Conversion to DOT NET of Microsft.VisualBasic.PowerPacks.LineShape and Microsoft.VisualBasic.PowerPacks.ShapeContainer

Posted on 2009-04-14
6
3,777 Views
Last Modified: 2013-11-08
hello,
I have migarted a VB6.0 Project to VB.Net. There was a code as Microsoft.VisualBasic.PowerPacks.LineShape and Microsoft.VisualBasic.PowerPacks.ShapeContaine. The type no more exists in DOT NET environment. Can anyone please tell me the equivalent to be used in DOT NET or how to proceed to achieve the same.
Thanks
Public WithEvents linSize As Microsoft.VisualBasic.PowerPacks.LineShape
Public WithEvents ShapeContainer1 As Microsoft.VisualBasic.PowerPacks.ShapeContainer

Open in new window

0
Comment
Question by:MPakeezah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 39

Expert Comment

by:abel
ID: 24136521
You can still use them. Include a reference to Microsoft.VisualBasic.PowerPacks.Vs (rightclick project, click Add Reference, search on the .NET tab for the right name) and then add an Imports statement on the top of your class:

Imports Microsoft.VisualBasic.PowerPacks

after that you can port your code the same way you ported the other code. Recent reference for .NET 3.5 about ShapeContainer: http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.powerpacks.shapecontainer.aspx

-- Abel --
0
 

Author Comment

by:MPakeezah
ID: 24136542
I forgot to mention that all references to Visual Basic Needs to be removed. The  code will be future migrated to C#.Net.
Please provide me with another solution.
Thanks.
0
 
LVL 39

Expert Comment

by:abel
ID: 24136585
This is not a reference to VisualBasic. It is a reference to a .NET library that is part of the .NET framework (and will stay part of it in the distant future, just like System or Windows.Forms).

It is always available and Microsoft suggests you use it. The name of "VisualBasic" in the library is to make migration easier, but it has nothing to do with VB6 (which uses COM object and not managed .NET objects).

Why reinvent the wheel if it has already been reinvented (i.e., ported) for you?
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 39

Expert Comment

by:abel
ID: 24136600
PS: you do not even need to add extra libraries to your final package, it is part of the Common Language Runtime. This is the note of MS about it:
The Microsoft.VisualBasic.PowerPacks namespace contains classes for the Visual Basic Power Packs controls. Visual Basic Power Packs controls are additional Windows Forms controls. They were originally released as free add-ins and are now included in Visual Studio.
0
 

Author Comment

by:MPakeezah
ID: 24136648
Thanks, will get back after confirming if this Dot NET Reference can be kept.
Regards.
0
 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24136682
ok.

Note that where I said "Imports", you should use "using", like so, which is the way to make programming with namespaces easier:

using Microsoft.VisualBasic.PowerPacks;

(and send a message to MS to complain about the ill-naming of the package containing the name VisualBasic, assuming it cannot be used by other languages, which is ridiculous, you can just use it)
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

740 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