PDA

Click to See Complete Forum and Search --> : shaped forms


zmerlinz
Jun 30th, 2000, 03:10 PM
hi,

does anyone know where i can download a program that creates custom forms that can be the shape that you create and then you can put them in vb,

e.g. i want to create an oval form

Cheers

Merlin ?

zmerlinz
Jul 1st, 2000, 08:05 AM
hi

tried it and it couldn't find anything,

any other suggestions anyone ?


Merlin ?

Jul 1st, 2000, 08:26 AM
look for an activex component at http://www.download.com I know there is one, I downloaded one before, but I have lost my liking for activex controls so I havent really used it much.

zmerlinz
Jul 1st, 2000, 08:54 AM
hi

i' not after an active x control becasue i don't understadn how to use them,

i want a program that has already been written, i know one excists becasue i used it before, but ican't remember where i got it.

Merlin ?

parksie
Jul 1st, 2000, 10:19 AM
Alex Vallat's VB Shaped Form Creator: http://www.comports.com/AlexV/VBSFC.html

zmerlinz
Jul 1st, 2000, 10:43 AM
hi,

cheers parksie this was the actual version that i was looking for

Merlin ?

Paul Warren
Jul 5th, 2000, 05:47 AM
For something a little different you might like to try this, it creates a rather fetching star shaped form. Just juggle the number of points to change the shape.

[CODE]
Option Explicit

Private Type POINT_TYPE
x As Long
y As Long
End Type

Private Const NUM_POINTS = 10
Private Const SCALE_FAC = 5

Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hrgn As Long, ByVal bRedraw As Boolean) As Long

Private Declare Function CreatePolygonRgn Lib "gdi32.dll" (lpPoint As POINT_TYPE, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long

Private Sub Form_Load()

Dim vertex(0 To NUM_POINTS) As POINT_TYPE ' array of region's vertices

Me.AutoRedraw = True

' Load the vertices of the triangular region into the array.
vertex(0).x = 10 * SCALE_FAC: vertex(0).y = 15 * SCALE_FAC
vertex(1).x = 14 * SCALE_FAC: vertex(1).y = 14 * SCALE_FAC
vertex(2).x = 15 * SCALE_FAC: vertex(2).y = 10 * SCALE_FAC
vertex(3).x = 16 * SCALE_FAC: vertex(3).y = 14 * SCALE_FAC
vertex(4).x = 20 * SCALE_FAC: vertex(4).y = 15 * SCALE_FAC
vertex(5).x = 17 * SCALE_FAC: vertex(5).y = 17 * SCALE_FAC
vertex(6).x = 20 * SCALE_FAC: vertex(6).y = 25 * SCALE_FAC
vertex(7).x = 15 * SCALE_FAC: vertex(7).y = 18 * SCALE_FAC
vertex(8).x = 10 * SCALE_FAC: vertex(8).y = 25 * SCALE_FAC
vertex(9).x = 13 * SCALE_FAC: vertex(9).y = 17 * SCALE_FAC

' Create the polygonal region based on the array of vertices.
SetWindowRgn hwnd, CreatePolygonRgn(vertex(0), NUM_POINTS, 2), True ' for a triangle, fill mode is irrelevant

'SetWindowRgn hwnd, CreateEllipticRgn(15, 5, 5, 15), True

End Sub