Transparent UserControl Oddities-VBForums
Results 1 to 2 of 2

Thread: Transparent UserControl Oddities

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2014
    Posts
    526

    Transparent UserControl Oddities

    Out of my mind once again playing around with a Transparent UserControl and experiencing some strange behavior with the standard VB Line and Shape controls.

    Thereís no code anywhere in the example that Iíve uploaded, just a single Form and one UserControl. The UserControl does nothing but has a short black Line, a small rectangular Shape, and then a second Shape with no height to it making a thin black line.

    I changed the background color to make it easier to see whatís happening. The Line drawn on the UserControl is 46 pixels in length, and both Shapes are also 46 pixels. Using Microsoftís desktop magnifier, depending on how you interpret the results, you will see that the Line has been drawn with 47 pixels, with the last pixel being set to white. Or the Line is the correct length of 46 pixels and the ending or last position of the graphics cursor left a white spot at pixel 47.

    As for the first Shape, the size is correct but the very first pixel at the top left corner has either not been drawn or set using the background color of the Form making it appear as if itís missing.

    The last control, the second Shape with a zero height is displayed as a single pixel with no length or height.

    Iím not all that familiar with Transparent UserControls, but this seems really odd and I was wondering if anybody could offer a reason or solution for this behavior.

    Thanks.
    Attached Files Attached Files
    Last edited by stuck-n-past; Sep 13th, 2017 at 10:40 PM.

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2014
    Posts
    526

    Re: Transparent UserControl Oddities

    I couldn't fix the problem, so I went ahead and just wrote my own Line and Shape UserControls. Bit of a pain, but they now work as needed.

    I was hoping that the fix to my other problem of not having my IDE up to date with Service Pack 6 might fix this problem as well, but it didn't have any affect.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.