none
Issues with programs using Visual Basic Powerpacks.

    Question

  • I have used the "Line Shape" and the "RectangleShape" from the Visual Basic Powerpacks in one of my programs. I simply used them to break up or distinguish several different areas on several different forms. My program runs just fine on my machine but when I try to run it on other machines it failed. I had to get this program done so I went back and used labels to draw the lines and boxes. Everything worked OK by doing it that way but it is much more difficult to get the same effect with labels. I don't remember the error that it generated but I was hoping someone else might have run into this before and that there is a simple solution to allow the use of the powerpacks. Does anyone have any thoughts or ideas why using the powerpacks would cause problems or how to resolve the problem?

    JR

    Saturday, April 29, 2017 3:50 AM

Answers

  • I have used the "Line Shape" and the "RectangleShape" from the Visual Basic Powerpacks in one of my programs. I simply used them to break up or distinguish several different areas on several different forms. My program runs just fine on my machine but when I try to run it on other machines it failed.

    The problem is associated with the support files required for the powerpacks controls.  It is compounded by issues with the version numbering.  You need to confirm that the user has exactly the same version of the DLL as you are using on the development machine, and the best way to do that is to include it as part of the installation package and install it to the user's machine with the rest of the application. But if the user already has a different version installed, that might not solve the problem.

    By far the best solution is to draw the lines to the form using graphics methods.   This is much simpler than trying to force labels or other controls to get the shapes you require.  For an example see:
    http://msdn.microsoft.com/en-us/library/aa984364(VS.71).aspx 

    If you use the Paint event of the form or control then there is no need to create your own Graphics object for drawing - the Graphics object is provided in the e argument of the method.

    • Marked as answer by J_Reid Saturday, April 29, 2017 4:47 AM
    Saturday, April 29, 2017 4:17 AM

All replies

  • Hi J_Reid,

    I'd like to confirm:
    (1) version of Visual Studio
    (2) at the present time, can you use "LineShape", "RectanglesShape", etc. in VB PowerPacks (in Designer View)?
    _____________
    Ashidacchi
    • Edited by Ashidacchi Saturday, April 29, 2017 4:07 AM
    Saturday, April 29, 2017 4:05 AM
  • I have used the "Line Shape" and the "RectangleShape" from the Visual Basic Powerpacks in one of my programs. I simply used them to break up or distinguish several different areas on several different forms. My program runs just fine on my machine but when I try to run it on other machines it failed.

    The problem is associated with the support files required for the powerpacks controls.  It is compounded by issues with the version numbering.  You need to confirm that the user has exactly the same version of the DLL as you are using on the development machine, and the best way to do that is to include it as part of the installation package and install it to the user's machine with the rest of the application. But if the user already has a different version installed, that might not solve the problem.

    By far the best solution is to draw the lines to the form using graphics methods.   This is much simpler than trying to force labels or other controls to get the shapes you require.  For an example see:
    http://msdn.microsoft.com/en-us/library/aa984364(VS.71).aspx 

    If you use the Paint event of the form or control then there is no need to create your own Graphics object for drawing - the Graphics object is provided in the e argument of the method.

    • Marked as answer by J_Reid Saturday, April 29, 2017 4:47 AM
    Saturday, April 29, 2017 4:17 AM
  • I am using Visual Studio 2015 and yes that is what I had done. I used the shapes in the designer view when I was creating my forms.

    JR

    Saturday, April 29, 2017 4:20 AM
  • Thanks for the answer. I kind of thought the issue with the DLL that you mention might be the problem. I also know what you are saying about drawing the shapes using graphics methods is the best solution. I was in a hurry to finish that particular program and that was an easy way to do it because I am not that familiar with using graphics methods. I guess it is time for me to learn more about using graphics as I now have another program where I would like to do some of the same things again. Just one more part of VB that I need to learn. 

    Thanks again for your response.


    JR

    Saturday, April 29, 2017 4:46 AM