Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-04-14
6
Medium Priority
?
3,930 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

636 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