-
Jun 7th, 2018, 06:19 AM
#1
Thread Starter
Member
Top left pixel of shape is not drawn
Hi everyone,
I've encountered some weird VB6 behavior, and searching the internet doesn't help much. I doubt that I'm the first with this problem though.
Anyway. Here's how to reproduce it:
1. Create a new VB6 project.
2. Add a new UserControl to the project.
3. Set the BackStyle of this UserControl to 0 - Transparent.
4. Place a rectangle Shape on the UserControl, with, solely for the sake of convenience, Left and Top close to the Left and Top of the UserControl.
5. Don't touch any of the Shape's other properties.
6. Put an instance of the UserControl on the Form and run the project.
The top left pixel of the shape is not drawn. How can this be fixed?
Thanks!
Cooz
-
Jun 7th, 2018, 07:10 AM
#2
Thread Starter
Member
Re: Top left pixel of shape is not drawn
An acceptable workaround is the addition of a 1 pixel high and wide line in this top left corner.
Problem solved as far as I'm concerned - although the behavior remains strange.
Kind regards,
Cooz
-
Jun 7th, 2018, 07:39 AM
#3
Re: Top left pixel of shape is not drawn
Interestingly, it seems to only be a problem with the combination of a UC and a shape. It's not just lightweight controls either, as I tried with a label and it works fine. It works fine with a textbox too. It also works fine if you push a line into the top-left corner of a UC.
And, just to say it, a shape works fine if it's not on a UC.
That one is truly a mystery.
Best Regards,
Elroy
EDIT1: A refresh of the shape on the UC doesn't help either. It just repaints it, still with the missing pixel. It's also strange that it's not a problem in the IDE design-mode. It's only during runtime that there's a problem.
Last edited by Elroy; Jun 7th, 2018 at 07:43 AM.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Jun 7th, 2018, 10:23 AM
#4
Re: Top left pixel of shape is not drawn
Don't know what other controls you plan on adding to that UC. But setting the Windowless property to True fixes that specific problem.
Another option could be to simply use APIs to draw a rectangle, oval, circle.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|