Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Shaped Form Help


i have tried to make shaped forms, and succeeded also, but by just getting code from some other source and copying and using it...
problem is

most part of the code i dont understand, i know use of api but to be honest really i cant understand most of it

can anyone helpme to explain in easy steps what does all that stuff means, or any place i can find it, step by step, for dummies like me.....

thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Shaped Form Help
i have tried to make shaped forms, and succeeded also, but by just getting code from some other source and copying and using it...
problem is

most part of the code i dont understand, i know use of api but to be honest really i cant understand most of it

can anyone helpme to explain in easy steps what does all that stuff means, or any place i can find it, step by step, for dummies like me.....

thanks

Odd Shaped Form
Any idea how I could get a form to look like the (bad) sketch below? I want a close button, a minimize button and a help button in the tab section. I also want the tab to be the same colour as the rest of the form (white)
______________
________/____|
|____________|
|____________|
|____________|
|____________|
|____________|
|____________|
|____________|

Thnx in Advance

Vb Shaped Form
does anyone knows where can i find the "vb shaped form creater" program?

Shaped Form Through API
 how i can shaped a form through API

Form Shadowing On A Custom-shaped Form...
Well, I'm a bit stumped here...

I've found some valuable source on creating semi-transparent drop shadows on VB forms; however, none of them appear to work properly on custom shaped forms. What I'm trying to do, is create a custom splash (similar to the semi-transparent & shadowed splash of Fruity Loops).

I can get the custom shape, and form transparency down; however, the shadows draw as if the form is still rectangular (appears along the edge where the form would be, if it were visible). I tried having the shadow create after the form paints; however, it doesn't help... still the same issue!

Can anybody point me in the direction on where I can find a solution to this! Thanks...

Respectfully,

Eric D. Brown

Picture Shaped Form
Hello,

I want my form to have the shape of a picture. So first I tried with SetLayeredWindowAttributes, without any succes. Some parts are transparent, but there's I line of the bg-color of the form around the picture. ( See demo below )

Second I tried it with BitBlt, The picture is showing ok, but the bg-color is still visible... How can i make my form have the shape of the picture??
I have placed my project below.

Sphere-Shaped Form
I'm trying to create a sphere shaped form (Not circle-shaped). I don't know why this code doesn't work right (I want it to be a black sphere that fades to white when it gets to the center):

Option Explicit
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByValhObject As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Dim lngRgn As Long
Public gapx As Single
Public gapy As Single

Private Sub Form_Activate()
Dim i As Long
For i = 0 To Me.ScaleWidth
Me.ForeColor = RGB(i, i, i)
Me.Circle (Me.ScaleWidth / 2, Me.ScaleHeight / 2), i, , , , 1
Next i
End Sub

Private Sub Form_Load()
Me.Height = Screen.Height
Me.Width = Screen.Width
Me.Width = Me.Height
lngRgn = CreateEllipticRgn(0, 0, ScaleX(Me.Width, vbTwips, vbPixels), ScaleY(Me.Height, vbTwips, vbPixels))
End Sub

Private Sub Form_Resize()
Call SetWindowRgn(Me.hwnd, lngRgn, True)
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call DeleteObject(lngRgn)
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
gapx = X
gapy = Y
End If
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
If Button = 1 Then
Form1.Move Form1.Left + X - gapx, Form1.Top + Y - gapy
End If
End Sub

I changed AutoRedraw to True and the BorderStyle equal to None.

Resizing A Shaped Form
Im using the attached code on a form. I am wondering how I would go about resizing the form along with the image.

Thanks.

SHAPED FORM PROGRAM!!!
This has to be the coolest program!!

http://members.fortunecity.com/alexv/

download: Shaped Form Creater

lets you draw shapes then it turns then into a shaped form!

A MUST HAVE !!!

Circular Shaped Form
ITtoolbox Portal for Visual Basic - http://visualbasic.ittoolbox.com/

Is it possible to create a form of Circular shape.
Does anyone have clue about this.

Thanks
Abizar

> ITtoolbox Portal for Visual Basic - http://visualbasic.ittoolbox.com/
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
>

How To Make Form Shaped Like 'donut'
How can we make VB form shaped like donut ?

Adding Manu To Shaped Form
hi
   i have form with bitmap i want to make this resizeable and add manu on to it
please help me how can i do this
provide me code some body have

Help Me How Can I Move Two Shaped Form Simultenously/concurrently
hi
i have two shaped form i want to move these two form simultanously mean if i move one form
then other form will move as i move first one please provide me some example code/demo code
waiting for response

Shaped RS
I am getting an error with this str for connection.. any thoughts?

strConnString = "Data Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Persist Security Info=False;Data Source=" & App.Path & _
"DefectMGRBackEnd.mdb;Mode=ReadWrite"

error invalid outside procedure at compile...

Set con = New ADODB.Connection
Set rst = New ADODB.Recordset
con.Provider = "MSDataShape"
con.ConnectionString = strConnectionString

con.Open

sCmd = "SHAPE {SELECT DefectReport_ID FROM tblDefectReport} " _
& "APPEND ({SELECT * FROM tblDefectDetails} " _
& "AS rstShapeForDetails " _
& "RELATE DefectReport_ID TO DefectDetail_tblDefectReportID)"

rst.Open sCmd, con, adOpenStatic, 2

Shaped Forms
last day i downloaded the WIn Media Player and wondered if there was a way to shape forms as a circle or other shapes like the mp does in designmode

Shaped Forms
Well heres the deal. For my program, I want to do a cool splash screen. I have some some I got that makes parts of the form transparent or shapes the form according to a certain color pixel. So I have a picture with pink pixels where i want the form shaped. It works, but the picture contains some diagonal lines, and when the form is shaped it looks pretty jagged. So is it possbile with any api routines to blur those parts of the form, or do some kind of antialiasing? If you look at the splash screen for adobe photoshop 7, they have a cool effect with a lens filter and a shped form, drop shadows, and where the form is shaped, it is smooth around the edges. Anyone know how I can do this? Take a look at my app and photoshop screenshots atached.

Look at those jagged edges where the diagonals are in my prog.
Look at how nice photoshop is!

Shaped Buttons Again
the problem i experience is that the images overlap and therefore clicking on one area can select the wrong object

also placing the shape on an actual button means the images cannot visibly overlap

any suggestions???


kev

Shaped Buttons
a quick question


i have two flat images that i would lik to use as buttons in a visual basic program ( they are basically shaped as + and }{)

Is there a method for converting images in to buttons other than using labels or placing the image in a square button????


cheers

kev

Different Shaped Forms
Is there a way to create non-rectangular forms? I want to make a circular form if this is possible...

Thanks

Help With Shaped Recordset
I'm trying to create a shaped ADO recordset, here's my code:
************
Sub datashape()
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim rschildren As Variant

cnn.ConnectionString = "Provider=MSDataShape.1;Data Provider=MICROSOFT.JET.OLEDB.3.51;Persist Security Info=False;Data Source=D:MyDocsvbReports_TutFAMILY.mdb"

'This connection string also fails
'cnn.ConnectionString = "Provider=MSDataShape.1;Driver={Microsoft Access Driver (*.mdb)};Dbq=D:MyDocsvbReports_Tutfamily.mdb;"

cnn.Open
rst.Open "SHAPE {select * from PARENTS} APPEND({select * from CHILDREN} AS chapter RELATE 'PARENT_ID' TO 'PARENT_ID')", cnn
Do While rst.EOF = False
Debug.Print rst("PARENT_NAME")
Set rschildren = rst("chapter")
Do While rschildren.EOF = false
Debug.Print rschildren(0), rschildren(1)
rschildren.MoveNext
Loop
rst.MoveNext
Loop
End Sub
***********
The trouble I'm having manifests in itself with an error indicating the rschildren object does not support the .EOF property. Examination of the rschildren in the local window displays the following error:

<Object or provider is not capable of performing requested operation>

It would appear the parent rst recordset is created properly but the APPEND is failing.

Any suggestions, I’m running out of hair…
TIA
Tom

Ado Shaped Recordset
how do i navigate in a ADO SHAPE recordset for updation purpose.

we are using the followig shape command to retrieve records from the database.

SHAPE {SELECT * FROM TBL_FMS_GA_AC_HD where AC_HD_CD=" & strParam2 & "and App_lock=0} AS AccountHead APPEND ({SELECT * FROM TBL_FMS_GA_BILL_BREAKUP} AS BillBreakUp RELATE 'AC_HD_CD' TO 'AC_HD_CD') AS BillBreakUp

After the above, we are trying to update the child record using the following command. this does'nt seem to work. The recordset does not move within the child recordset.

recLocal!BillBreakUp.Value.MoveNext

Shaped Forms
does anybody know how to resize a shaped form via mouse? like
what you do to a regular window when the mouse is over the
edge and you drag the side to resize the window.

thanks in advance!

Odd-shaped Controls
Im not sure if this is possible, but I want a picturebox that is shaped like an "L", like this:

Code:
+----+
| |
| |
| |
| ------+
|__________|

The only way I can think of doing this is connecting two pictureboxes together. The finished product must act as one picturebox. A control should be able to sit right in the little corner of the L when it is done. How would I do this?

Shaped Query.--- Can Anyone ???
I am having problen with shaped query...

sql = "SHAPE {SELECT Sys.school, Sys.add1, Sys.City, Sys.state, Sys.zip, Sys.phone, Sys.fax, Sys.principal,Sys.Sn, Stu.snum, Stu.sname, Stu.addr1, Stu.city, stu.State, Stu.zip, Stu.dob, Stu.Grade, GPA.rank, GPA.rank_of FROM ((GPA INNER JOIN Stu ON Stu.snum = GPA.snum AND Stu.sn = GPA.sn) INNER JOIN Sys ON Sys.Sn = Stu.sn)

WHERE stu.snum in (SELECT SNUM from #StuTran) and Stu.sn IN (SELECT DISTINCT sn FROM #StuTran)}

APPEND (
( " SHAPE {SELECT * FROM tblTerm}
APPEND({SELECT * FROM tblScore} as rsScore
RELATE Snum TO Snum,[Year] TO [Year],Sn TO Sn
) AS rsheader
RELATE Snum To Snum, Sn TO Sn )

rst.open.....blah blah

Here i am making hierarchy of parent - child - Grand children.

Is this right or not. Because when i try to access this ....

Set Rs1 = rst("rsHeader").Value

It says Rs1 EOF. That means no data for RS1. But as it is just a query of the tables tbl score and tblterm there is data in it.

Why is this happening. Please write back.

Odd Shaped Controls
My question is similar to Wangeng's question on 3/31 concerning shapes being buttons, except I am looking for a way to make a picture box be other than rectangular. The effect I am looking for is sort of a sunken light. I realize I could use a normal picture box as a guide and draw the desired shape in a graphics program (i.e., Paint Shop Pro), then simply place the resulting picture in an image control, but then I am faced with a color problem; namely, what if the user has a different Windows color scheme than mine. The "odd" portions of the picture (those parts that are supposed to appear to be the form but are in fact part of the picture) will be a different color than the form, causing the desired effect to be lost.

Also, d_yard's suggestion of using the VB Shaped Form Creator won't work the author doesn't appear to have made the source available.

I would appreciate any suggestions!

Shaped Forms
I know this has been mentioned before (many times) but can someone point me towards any hints and tips on producing strange shaped forms - eg circular, oval etc etc



------------------
Mark "Buzby" Beeton
VB Developer
BuzbyB@HotMail.Com

SQL - Shaped Recordesets
Hi

Is it possible to use shaped recordsets without using the data environment?
Using the code below without a data environment attached to the project gives errors.

oConn.CursorLocation = adUseClient
oConn.ConnectionString = DataEnvironment1.dbConnectionFAMS '
oConn.Open

 strSQL = "SHAPE { "
 strSQL = strSQL & "SELECT Child.* "
 strSQL = strSQL & "FROM Child "
 strSQL = strSQL & "WHERE childSurname = '" & strSurname & "' "
 strSQL = strSQL & "} AS Command1 "
 strSQL = strSQL & "APPEND ({ "
 strSQL = strSQL & "SELECT Payments.* "
 strSQL = strSQL & "FROM Payments "
 strSQL = strSQL & "WHERE paymentDateOfPayment "
 strSQL = strSQL & "BETWEEN #" & strFrom & "# "
 strSQL = strSQL & "AND #" & strTo & "# "
 strSQL = strSQL & "} AS Command2 "
 strSQL = strSQL & "RELATE 'childID' TO 'paymentChildID') "
 strSQL = strSQL & "AS Command2 "
  
 oRS.Open strSQL, oConn, adOpenForwardOnly
 Set drpPayments.DataSource = oRS

on this particular occasion the recordset is diplayed in a report - but this need not be the case
and i am aware the the connection method would change...

Perhaps someone could point me in the right direction or give some code examples

Many thanx

Different Shaped Forms
How do you make a form a different shape?

Odd Shaped Forms
Hi
I've made a custom shaped form(rounded rectangle) with the following API call
&lt;vbcode&gt;
hRgn = CreateRoundRectRgn(0, 0, 600, 500, 200, 200)
result = SetWindowRgn(main.hWnd, hRgn, True)
&lt;/vbcode&gt;
Now in my form i have the scale mode set to 0 and i have specified scaleheight as 800 and scalewidth as 600.it still works ok with my form.Now what does the above 600 and 500(in the api call) mean?This doesn't work properly when the resolution is reduced from 800 * 600 pixels!

Shaped Cmd Buttons
is there a way to make a different shaped command button in vb? something other than a rectangle or square, like a triangle. if not, is there a way to achieve the same functionality with a different shaped object?
thanks

Is It Possible To Make A Shaped Picture Box?
i have an exact space that I need a picture box to fit into. it's is semi-rectangular having it left corners rounded off. I realize I can just make a form and set it on top the main form and shell the graphis to the hWnd of the form and have it be the right shape. I was just wonder if there was another way cause doing it with a form seems kinda like the stupid way out type solution to me, but then what do I know. Any input would be awsome. Thanks

Custom Shaped Windows
Is there a way to design a custom shaped window? Like if I wanted an oval or octogonal window instead of the standard rectangle/square?

Thanks,

Tom

Custom Shaped Buttons
I did not find a solution for this in archive:

I want to use a button that is not rectangular and I do not want the area around my shape to be clickable (red arrow shows this area in attachment). I may position another shaped-button so closed to this that this second button's active area overlaps the first button's unclickable (inactive) area.

Note: I would like to combine this effect with transparent (custom-shaped) forms to acheive a powerful graphic effect.

Thanks,
Endre

Funny Shaped Forms
Hallo
Does anyone know how to make a form with an invisible section? I would like to have my form a square, but then have one corner invisible, so its a funky shape.
Thanks in advance...

VB Project Gone Pear-shaped!
hi all,

i have a project made in vb, which compiled and ran well. then i made some additions by on new forms but now some of the original ones wont work! ive attached the working one (version 7) and the non-working one (version 8).

anyway if someone could tell me what ive done to make my working forms fail could they reply. the forms are player, match and match details. ive been told to create a DSN using windows adminstrative tools, but this doesnt solve the problems.

and if someone could tell me why i get the datareport error that would also be great! this occurs whenever i click 'report' on match statistics, detailed statistics or playerstat.

TIA,

Robert

Irregular-shaped PictureBox?
Is it somehow possible to make a PictureBox have an
irregular-shape (user defined)?

And if that is not possible, doing something like
having a regular rectangular PictureBox then 'masking out'
certain areas (with a bitmap drawing perhaps)??

Custom Shaped Forms
does anyone know how i could make custom shaped forms?

Sort A Shaped Recordset
Is it possible to sort a shaped recordset? I would like the user to be able to sort the recordset without having to request the data again from the database. I tried using recordset.sort method but it didn't work with a shaped recordset.

Here's what I have:


Code:
strSQL = "SELECT InvNum AS [Invoice #], InvDate AS [Invoice Date],CompanyName AS [Customer],JobName AS [Job], Format(Total,'$ #,##0.00') AS [Total], " & _
"InvStatus.Description AS [Status] " & _
"FROM InvStatus RIGHT JOIN(Contacts RIGHT JOIN (Jobs RIGHT JOIN Invoices ON Invoices.JobNum = Jobs.JobNumber) " & _
"ON Invoices.CustomerID = Contacts.ContactID) ON Invoices.Status = InvStatus.InvStatus " & _
"WHERE Invoices.Status BETWEEN 0 AND 2 "

strAppend = "SELECT IIF(sum(amount) IS NULL,'$ 0.00',Format(SUM(Amount),'$ #,##0.00')) AS [Payments & Credits] FROM PaymentsDetail WHERE InvNum = ?"

strShape = "SHAPE {" & strSQL & "} AS rsInv " & _
"APPEND ({" & strAppend & "} AS rsPay " & _
"RELATE 'Invoice #' TO PARAMETER 0) AS rsShaped"

rsInvoices.Open strShape, cnShape, adOpenKeyset
I would like to sort on the fields in rsInv

Any help would be appreciated

Populate A Shaped Recordset
How do you add the child records in a fabricated shaped recordset? I have created the shaped recordset and can add data to the parent records but can't figure out how to add the child records.

Here's a simple example of what I'm doing. This works fine for the parents but I just can't figure out how to add the child records.


Dim cn As New ADODB.Connection
Dim rsAcct As New ADODB.Recordset
Dim strShape As String

cn.Open "Provider=MSDataShape;Data Provider=NONE;"

strShape = _
"SHAPE APPEND NEW adInteger AS AcctNum," & _
" NEW adChar(50) AS Code," & _
" ((SHAPE APPEND NEW adInteger AS AcctID," & _
" NEW adInteger AS InvNum," & _
" NEW adchar(15) AS InvDate," & _
" NEW adDouble AS Total," & _
" NEW adDouble AS Paid," & _
" NEW addouble AS Balance)" & _
"AS rsInv RELATE AcctNum TO AcctID) "

rsAcct.Open strShape, cn, adOpenStatic, adLockOptimistic, -1

With rsAcct
.AddNew
!AcctNum.Value = 2020
!Code.Value = "Big Company"
End With
Debug.Print rsAcct!AcctNum; rsAcct!Code;

Need Some Help With Obscure Shaped Forms API
Hey guys,

The API here: http://www.vbforums.com/showpost.php...27&postcount=5 allows you to do custom shaped forms, namely rectangular with rounded edges. It works well, it's easy and lightweight and I use it often.

When you [uncomment] and apply your needed parameters to one of the hRgn lines, it will round the corners based off of your given values


Code:
hRgn = CreateRoundRectRgn(0, 0, w, h, 9, 9)


Imagine you have a form with rounded corners like this; http://img507.imageshack.us/img507/2479/form1sp2.jpg - A result of something using the code I just pasted above.

My question is, how can I tell it to crop my form like this as well: http://img53.imageshack.us/img53/8035/form2tv5.jpg

My natural assumption was to modify the above code to something like this:


Quote:




hRgn = CreateRoundRectRgn(0, 120, w, h, 9, 9)






But by doing this it cropped off the top portion. Then it looked like this, http://img132.imageshack.us/img132/9818/form3qo5.jpg

Again, the way I want it to look is like this: http://img53.imageshack.us/img53/8035/form2tv5.jpg

I understand thats not how this API is supposed to work, and it is only doing what it thinks it should by giving me undesired effects, but I was wondering what I can do to modify or add this ability.

Sorry if I didn't explain well, I tried to make it easy to understand with basic pictures and stuff. Any responses would be great and much appreciated!

Thanks!!

David

Different Shaped Command Buttons How?
How do you make different shaped command buttons?

Frame Shaped Like A TabStrip?
Hi,
We have the requirement to embed a "frame" control, but it needs to look like a tabstrip. I'm not sure if a control existed like that cos we have the analysis document that has a screnn shot of this. Attaching a part of snapshot here.

Does anyone know if this was some component reference i need to include?
Thanks,
Jemima.

Trickey: Odd Shaped Forms
Howdy

How Can I create an odd shaped form, instead of rectanular I want an L shaped one, I have see it done before (well it was circular).

Any Ideas??

Cheers

Geoff

Irregular Shaped Forms...
Hello,
I have a few scanned stickers from a collection I have from the 80's. I am trying to add this scans to individual forms (irregular shaped of course to create "desktop" stickers. Can you create these types of forms in VB ?
Thanks,

Odd Shaped Command Buttons
I would like some help on creating shaped command buttons?

Thanks
Amitabh

Disconnected Shaped Recordset
I found this thread:

thread222-697283

Can someone explain how I am to populate the disconnected recordset with the shaped data after the recordset has been created?  Thanks.

Swi

Custom Shaped Forms
Is it possible to create a form of an other shape then rectangular?

eg. I want to make a round form, or triangle

I have seen this once using API's, but I haven't got the smallest clue on how to do this.

Tom Cannaerts
slisse@planetinternet.be

The best way to escape a problem, is to solve it.

Shaped PicBox (Picture Box Shape)
Thie was a code snippet for making round pictureboxes presented in this thread from "sugared":

http://www.xtremevbtalk.com/t137176.html

I wanted to see if it would actually work so I tried it in a project and of course it doesn't.

I tried different AutoRedraw settings combinations (none worked):
picObject.AutoRedraw = True, Form1.AutoRedraw = True
picObject.AutoRedraw = True, Form1.AutoRedraw = False
picObject.AutoRedraw = False, Form1.AutoRedraw = False
picObject.AutoRedraw = False, Form1.AutoRedraw = True

Here's the code

Code:
'DOESN'T WORK
Private Sub cmdMakeRound_Click()
Dim i As Long
Dim intD As Integer
Dim hRgn As Long

intD = 1000

BeginPath picObject.hdc
picObject.Circle (intD / 2, intD / 2), intD / 2
EndPath picObject.hdc
hRgn = PathToRegion(picObject.hdc)
SetWindowRgn picObject.hWnd, hRgn, False
picObject.Circle (intD / 2, intD / 2), intD / 2, vbBlack

End Sub
Here's the code from the modPicBoxShape that I used:

Code:
Public Declare Function BeginPath Lib "gdi32" (ByVal hdc As Long) As Long
Public Declare Function EndPath Lib "gdi32" (ByVal hdc As Long) As Long
Public Declare Function PathToRegion Lib "gdi32" (ByVal hdc As Long) As Long
Public Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

However I did find some working code that did the same thing with using text as the region shaper:
(I used the same modPicBoxShape.bas code as above):


Code:
'DOES WORK
Private Sub Form_Load()
Const TXT = "Hello!"

Dim i As Long
Dim hRgn As Long

Picture1.AutoRedraw = True

' Select a big font.
Picture1.Font.Name = "Times New Roman"
Picture1.Font.Bold = True
Picture1.Font.Size = 50

' Make the PictureBox big enough.
Picture1.Width = Picture1.TextWidth(TXT)
Picture1.Height = Picture1.TextHeight(TXT)

' Make the clipping path.
BeginPath Picture1.hdc
Picture1.CurrentX = 0
Picture1.CurrentY = 0
Picture1.Print TXT
EndPath Picture1.hdc

' Convert the path into a region.
hRgn = PathToRegion(Picture1.hdc)

' Constrain the PictureBox to the region.
SetWindowRgn Picture1.hWnd, hRgn, False

' Draw some lines on the form.
AutoRedraw = True
For i = 0 To ScaleHeight Step 60
Line (0, i)-Step(ScaleWidth, 0), RGB(0, 128, 255)
Next i

End Sub

The "hRGN" variable shows "O" in the "Private Sub cmdMakeRound_Clic"
when I set a breakpoint at the following line:
SetWindowRgn Picture1.hWnd, hRgn, False

But in the textshape code above it shows a number other than O, so (I guess) in first set of code the line that starts with
"hRgn = PathToRegion " doesn't work and in the second set of code it does. Very curious...

I thought maybe it was the "obj" code so I tried this:


Code:
Private Sub cmdMakeRound_Click()
Dim i As Long
Dim intD As Integer
Dim hRgn As Long

intD = 1000
picObject.AutoRedraw = True
picObject.CurrentX = 0
picObject.CurrentY = 0

BeginPath picObject.hdc
picObject.Circle (intD / 2, intD / 2), intD / 2
EndPath picObject.hdc
hRgn = PathToRegion(picObject.hdc)
SetWindowRgn picObject.hWnd, hRgn, False

picObject.Circle (intD / 2, intD / 2), intD / 2, vbBlack

' Draw some lines on the form.
AutoRedraw = True
For i = 0 To ScaleHeight Step 60
Line (0, i)-Step(ScaleWidth, 0), RGB(0, 128, 255)
Next i

End Sub

But it also didn't work...does anyone know why? I'm scratching my head (and probably missing something very obvious...)

Irregular Shaped Picture Control
How do i turn an irregular shaped picture(not rectangular) into a control that has a click event?

Copyright © 2005-08 www.BigResource.com, All rights reserved