Note: There is also an OCX version. It has a LineEx control added.
It is windowless, as the original.
It can be used as a direct replacement of the original VB-Shape control (by manually editing the *.frm source files... for the one familiar with doing that).
Perhaps the main feature over the original control is that is is antialiased. It means that the shape is rendered with more quality:
The second new feature is that it has more shapes.
Here there is a screenshot:
New properties:
Opacity: as the names says, it sets the opacity -or transparency-.
RotationDegrees: the shape can be rotated 0-360ยบ.
Flipped: the shape can be flipped horizontally and/or vertically.
CurvingFactor: This value applies to shapes that are not normally curved like the rectangle, the triangle and several others. It produces new figures by curving the edges. It accepts values in the range from -100 to 100. 0 meaning not curved.
Shift: It is an additional value used by some controls: triangle scalene, kite, diamond, trapezoid, parallelogram, star, jagged star, arrow, crescent and talk. It accepts positive and negative values. Most useful values will be often in the range of -10 to 50.
Vertices: Value used by these shapes: regular polygon, star and jagged star.
Quality: High or Low (antialiased or not).
Clickable: It determines whether the control will raise mouse events or not. If False, any control behind it will receive the events instead.
Style3D: Allows to see the shape with a 3D look.
This control uses subclassing (but it is optional in IDE, look at the UseSubclassing property).
Requirements: it uses GDI+, it was introduced in Windows XP.
Changelog:
17-sep-22 Added new shape Pie.
17-sep-22 Improved rendering in some edge cases.
17-sep-22 Added Style3DEffect property.
15-sep-22 Added Style3D property.
01-jul-22 Added al BorderStyle options that were available in the original Shape control.
22-mar-19 Original release
29-mar-19 Latest update: Improvements, bug fixes. Added another shape. Now the "talk" shape can accept negative values in the Shift property.
Hello. To add text there is a control that is specific: the Label. Put a label over the shape and set the backstyle to transparent.
I don't know if there is much of a a point in adding the capacity to draw text to the ShapeEx control, since it is quite easy to put a label inside the shape.
The difficulty in adding text capacity to the ShapeEx control itself is that the text should not go outside of the shape, and for some shapes that is quite difficult to do (or impossible).
So, what's the problem in adding a label over it? You can place the label exactly in the position that you want, after you has set up the shape that you wanted.
If I decide to add the text capacity (may be in the future), perhaps it will be restricted only to some shapes.
Originally Posted by DaveDavis
or drag to resize and movement like MS Office, it will be useful in many applications.
I don't know what you mean, could you explain?
Do you mean it to have at run-time some similar capacity as the controls have in the IDE (of showing grips and being able to be moved and resized by the user)?
Last edited by Eduardo-; Mar 29th, 2019 at 09:29 PM.
... perhaps it will be restricted only to some shapes.
yes, for star etc, it is not grace to have text into.
Originally Posted by Eduardo-
Do you mean it to have at run-time some similar capacity as the controls have in the IDE (of showing grips and being able to be moved and resized by the user)?
I means we can adjust size at run-time or design-time using mouse.
Hi Eduardo, I'm checking your ShapeEx, I'm going to use it to test wqweto's MST.
Your ShapeEx is great, which can generate a lot of irregular graphics, but these graphics are rarely used in our programming. If your ShapeEx could generate Win10 system icons, its usefulness will be greatly improved.
Hi Eduardo, I'm checking your ShapeEx, I'm going to use it to test wqweto's MST.
Your ShapeEx is great, which can generate a lot of irregular graphics, but these graphics are rarely used in our programming. If your ShapeEx could generate Win10 system icons, its usefulness will be greatly improved.
Hello,
Where are all those Windows 10 icons?
Perhaps I'll make them at some point.
About the shapes, I probably never used any shape in my programs, or at least I can't remember.
The original purpose of this control was to make a shape control replacement but antialiased.
Anyway, I think that a SVG renderer would be more useful.
Amazing contribution Eduardo!!!
Im working hard on gattering control replacements to give vb6 a modern look. For the IDE Im using AxTools wich is awesome and some controls I found so far are this and the SSTabEx (extended version of sheridan tabs).
Do you have any more usefull replacements or cool controls to share? (send me a private if you want)
Im working on creating a set of new controls (a new button with tons of propertys, shadow and autocreate disabled icon) now I changed to ShapeEx for the background object.
Do you have any transparent rotated antialiased label control?
I also coded the only Flat combo box arround after not finding anyone wich works (Right now works, but I want to push it a little more and completely replace the dropdown graphic)
I also coded the only Flat combo box arround after not finding anyone wich works (Right now works, but I want to push it a little more and completely replace the dropdown graphic)
What I do is to set the controls to use the Windows theme, then the comboboxes (and other controls) appear flat.
I tried that approach but the problem is that if you relay on themes you dont really know how it will really look on the client machines. For example my work computer has themes disabled, my home computer got aero (win7) and my laptop windows10. I want to have controls that dont depend on user themes/colors/windows version so I can design wysiwyg and provide the same user experience.
Yes, but most of them fail to be fully flat or are not based on standard ComboBox (cant replace the component and get everything working wich is not good for big projects)
Thanks Eduardo! As you can see that one fail to do a full flat on the bottom line. I based my work on that one and modified the paint proc to my taste.
Same happen with shapes and lines and any control that is not 'windowed' (image control,shape,lines,etc. )
You can put it inside a picturebox to have zorder. But doing that you will lose the transparency that is the advantage of windowless controls.
Same happen with shapes and lines and any control that is not 'windowed' (image control,shape,lines,etc. )
You can put it inside a picturebox to have zorder. But doing that you will lose the transparency that is the advantage of windowless controls.
Code:
Private Sub UserControl_Show()
If Not Ambient.UserMode Then
UserControl.BackStyle = 1
Else
ShowAllChildArea
End If
End Sub
Sub ShowAllChildArea()
Dim Obj As Control
Dim id As Long
For Each Obj In ContainedControls
id = id + 1
If id > Area.Count - 1 Then Load Area(id)
Area(id).Width = Obj.Width
Area(id).Height = Obj.Height
Area(id).Left = Obj.Left
Area(id).Top = Obj.Top
Area(id).Visible = True
Next
End Sub
VB6 UserControl-Transparency Container-VBForums https://www.vbforums.com/showthread....ency-Container
With my transparent container approach, it only takes a few lines of code to break this barrier for many "usercontrols" that cannot be superimposed on other controls. The downside is that you need one more "user control". You're welcome to change it, and you'll end up with only one user control.
Last edited by xiaoyao; Mar 29th, 2021 at 05:30 PM.
change sample about "shift " value to 5552,If the width of the control is only 300 pixels, sometimes the actual content part displayed is only 200 pixels, or maybe 600 pixels, exceeding the size of the control itself.Is there any way to get the actual coordinates of the final display image?rect info。
I tested it yesterday and found that the text label on my transparent container displayed a slightly different color.my label font color is red
Last edited by xiaoyao; Mar 29th, 2021 at 05:40 PM.
It is possible with this control instead, but it has only standard (VB6 original) shapes.
Originally Posted by xiaoyao
change sample about "shift " value to 5552,If the width of the control is only 300 pixels, sometimes the actual content part displayed is only 200 pixels, or maybe 600 pixels, exceeding the size of the control itself.Is there any way to get the actual coordinates of the final display image?rect info
Currently not.
Originally Posted by xiaoyao
I tested it yesterday and found that the text label on my transparent container displayed a slightly different color.my label font color is red
Humm, color should be accurate. In any case please post (a minimal) sample test project.
I upload the source code in this forum example of the space is only 10 megabytes, how to become larger? Like a hundred megabytes.
IDK.
About the issue, I think that the rendering of the text gets blended with the the background color due to anti-aliasing, and since the transparent color is only one (no shades) then what you are seeing is part of the background blended with the caption of the label that didn't get transparent because the color didn't match exactly.
For true transparency render the text with GDI+.
And BTW that has nothing to do with the ShapeEx control.
Last edited by Eduardo-; Apr 5th, 2021 at 10:46 PM.
Eduardo, just tried it for the first time and it looks good.
Can you explain what the need is for the subclassing?
In a quick test I disabled the subclassing and didnโt notice a difference.
Yes, sorry, the subclassing is for ensuring a correct painting (and background erasing) when the figure goes out of the rectangle.
For most cases you can remove it without any difference.
Awesome Control. Really handy. Is there a way to change the border pattern to dotted or dashed? I'm writing a program that will allow me to draw a selection box on an image which will be cropped. Also is there a method of settings its ZOrder to appear on top of a picture box ? Thanks again!
Is there a way to change the border pattern to dotted or dashed? I'm writing a program that will allow me to draw a selection box on an image which will be cropped.
I added options to the BorderStyle property. Now it matches the original.
Only that the dots and dashes are smaller (with GDI+ than were with GDI), so maybe you want to set a BorderWidth > 1.
It can draw border styles other than solid with BorderWidth > 1, the original VB Shape control didn't allow that.
Originally Posted by Maddis
Also is there a method of settings its ZOrder to appear on top of a picture box ? Thanks again!
No, because it is a windowless control. If you want to put it over a PictureBox, you need to put the shape control inside a PictureBox also.
Or you could use this other control, but it is quite limited, it is only like the VB original but that can be placed over PictureBoxes.
As always I have to hand it to you. Real expertise, but I also appreciate the other contributors.
I could not have imagined in my wildest dreams that I would get such a response.
Your program is quite elaborate, but I would like further advice on how to create a shape.
Attached is a picture of the shapes I need to do, and I will appreciate if you can give me some tips on how to start.