Quick Search for:  in language:    
VB5,VB6,function,create,transparent,area,dirr
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,011,557. lines
 Jobs: 115. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
AniViewer
By Jerrame Hertz on 6/30


Click here to see a screenshot of this code!Raw Packet Sniffer
By Coding Genius on 6/30

(Screen Shot)

Check the support of a record set
By Freebug on 6/30


B++ Builder - VB without runtimes
By Anthonius on 6/30


Mr Blonde - Chat Program
By Mr Blonde on 6/30


MSN Messenger Status Detector
By Ryan Cain on 6/30


MSN advanced
By alias1990 on 6/30


MSN Messenger advanced
By alias1990 on 6/30


Locate Database
By Erica Ziegler-Roberts on 6/30


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Make a Transparent Area (Any Size) in your Form

Print
Email
 

Submitted on: 4/23/1999
By: Dalin Nie 
Level: Not Given
User Rating: By 109 Users
Compatibility:VB 5.0, VB 6.0

Users have accessed this code 16811 times.
 
 
     This function create a transparent area of dirrent shape (such as rectangle, Circle) in your form, you specify where and how big the hole is. Unlike most other trnsparant routine, this one not only let you see trough it, but also allow you total access access the things in the hole!!! Of course, You can make the entire form transparent or make you form C - shaped! Fully tested in VB5 and VB6.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

'**************************************
' Name: Make a Transparent Area (Any Siz
'     e) in your Form
' Description:This function create a tra
'     nsparent area of dirrent shape (such as 
'     rectangle, Circle) 
In your form, you specify where and how big the hole is. Unlike most other trnsparant 
routine, this one Not only Let you see trough it, but also allow you total access 
access the things in the hole!!! Of course, You can make the entire form transparent 
or make you form C - shaped!
Fully tested In VB5 and VB6.
' By: Dalin Nie
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     wCode.asp?txtCodeId=1617&lngWId;=1'for details.'**************************************

'1, Declararion
' This should be in the form's General D
'     eclaration Area. If you declare in a Mod
'     eule,
' you need to omit the word "private"

Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
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 CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
    '2 The Function
    ' This should be in the form's code. 

Private Function fMakeATranspArea(AreaType As String, pCordinate() As Long) As Boolean

'Name: fMakeATranpArea 'Author: Dalin Nie 'Date: 5/18/98 'Purpose: Create a Transprarent Area in ' a form so that you can see through 'Input: Areatype : a String indicate wha ' t kind of hole shape it would like to ma ' ke ' PCordinate : the cordinate area needed ' for create the shape: ' Example: X1, Y1, X2, Y2 for Rectangle 'OutPut: A boolean Const RGN_DIFF = 4 Dim lOriginalForm As Long Dim ltheHole As Long Dim lNewForm As Long Dim lFwidth As Single Dim lFHeight As Single Dim lborder_width As Single Dim ltitle_height As Single On Error Goto Trap lFwidth = ScaleX(Width, vbTwips, vbPixels) lFHeight = ScaleY(Height, vbTwips, vbPixels) lOriginalForm = CreateRectRgn(0, 0, lFwidth, lFHeight) lborder_width = (lFHeight - ScaleWidth) / 2 ltitle_height = lFHeight - lborder_width - ScaleHeight Select Case AreaType Case "Elliptic" ltheHole = CreateEllipticRgn(pCordinate(1), pCordinate(2), pCordinate(3), pCordinate(4)) Case "RectAngle" ltheHole = CreateRectRgn(pCordinate(1), pCordinate(2), pCordinate(3), pCordinate(4)) Case "RoundRect" ltheHole = CreateRoundRectRgn(pCordinate(1), pCordinate(2), pCordinate(3), pCordinate(4), pCordinate(5), pCordinate(6)) Case "Circle" ltheHole = CreateRoundRectRgn(pCordinate(1), pCordinate(2), pCordinate(3), pCordinate(4), pCordinate(3), pCordinate(4)) Case Else MsgBox "Unknown Shape!!" Exit Function End Select
lNewForm = CreateRectRgn(0, 0, 0, 0) CombineRgn lNewForm, lOriginalForm, _ ltheHole, RGN_DIFF SetWindowRgn hWnd, lNewForm, True Me.Refresh fMakeATranspArea = True Exit Function Trap: MsgBox "error Occurred. Error # " & Err.Number & ", " & Err.Description End Function
' 3 How To Call Dim lParam(1 To 6) As Long lParam(1) = 100 lParam(2) = 100 lParam(3) = 250 lParam(4) = 250 lParam(5) = 50 lParam(6) = 50 Call fMakeATranspArea("RoundRect", lParam()) 'Call fMakeATranspArea("RectAngle", lPar ' am()) 'Call fMakeATranspArea("Circle", lParam( ' )) 'Call fMakeATranspArea("Elliptic", lPara ' m())


Other 2 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
4/19/1999 8:27:00 AM:anti
I'm making a project in VB 3.o [I 
normally use 5.o tho], and this code is 
unfortunatly for 32 bit programming 
only. If anyone has a similar code for 
16 bit basic, please email me with it; 
elite_83@hotmail.com.  
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/21/1999 7:22:00 PM:skafia
I cant seem to get this code working, 
it keeps giving me errors with the 
source, im using vb5, email me if you 
can help.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/22/1999 5:09:00 AM:Dalin
I just tested it again, and it works 
fine.
Did you declare in a module? 
What is the error
message?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/22/1999 9:33:00 AM:DJLawlor
This one is so cooooooooooooooool!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/23/1999 6:24:00 PM:John Barden
I have not yet used this, but will it 
allow me have a maximized transparent 
form and run other applications within 
it?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/24/1999 4:05:00 AM:Dalin
To John Barden: Yes!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/1/1999 7:57:00 AM:Ian Ippolito
This code worked for me on the first 
try.  This is really cool!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/1/1999 11:46:00 AM:Eric M
Im unclear about the positioning you 
have in this..I cant seem to figure it 
out.. What is lparam 1-6 like lparam 1 
in the example is that the topright ? 
anyways im familiar with x1 and y1 but 
thats only 4 numbers you have 6 
numbers..
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/2/1999 6:52:00 PM:Jay
Can someone direct me trought the 
proccess of this source code please i 
follwed the instruction and exceute he 
code but nothig happens i only see the 
regular form no hols or any thing in it 
so please help me with this .
thanks 
in advance.
jay...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/2/1999 10:48:00 PM:Terrance Henry Shaw
I don't really get how you use this 
code.  It is so confusing.  Where do I 
enter the code?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/3/1999 8:29:00 AM:Doug Bumbalough
Great code!  Worked on first try!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/3/1999 9:27:00 PM:ZeRoFrEEzE
Kool stuff, im 16 years old, and got it 
on the first try. Anyone interested on 
testing out software, please e-mail me 
and ill send you some stuff i created...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/4/1999 7:43:00 AM:DOROSMAN
Super!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/4/1999 5:23:00 PM:Asim
This is so wicked. The only thing is 
that it doesn't support curne shapes. 
if know how please email me. thnaks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/5/1999 7:47:00 AM:dave shields
superb!
worked first time
to all 
those having problems....
have you 
followed the instructions and applied 
the calling code to an action (a button 
for instance)?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/5/1999 2:55:00 PM:SoPa
Great Code!!!
Worked on the first 
try!
Thanxs a lot man!
But can u 
perhaps make a note of each step 
of 
the code??
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/5/1999 5:19:00 PM:Flip
really really coool.  
Not sure what 
I'll use this for, but I'm sure to 
think of something!
for those having 
probs...don't skip step three and 
assign this event to Form_Load if 
nothing else.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/1999 5:02:00 AM:Marcus
Excellent piece of work, its a bit iffy 
when you move the form, but thats about 
it.  I'm not sure what I'm going to use 
it for though.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/1999 5:28:00 AM:Marcus
Add the following code to a timer and 
watch the zany efects:
Private Sub 
Timer1_Timer()
Dim lParam(1 To 6) As 
Long
lParam(1) = Int(Rnd() * 
Me.Width / 15)
lParam(2) = Int(Rnd() * 
Me.Height / 15)
lParam(3) = Int(Rnd() 
* Me.Width / 15)
lParam(4) = Int(Rnd() 
* Me.Height / 15)
lParam(5) = 
50
lParam(6) = 50
Select Case 
Int(Rnd() * 4)
Case 0
    Call 
fMakeATranspArea("RoundRect", 
lParam())
Case 1
    Call 
fMakeATranspArea("RectAngle", 
lParam())
Case 2
    Call 
fMakeATranspArea("Circle", 
lParam())
Case 3
    Call 
fMakeATranspArea("Elliptic", 
lParam())
End Select
End Sub
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/1999 10:03:00 AM:eric chastain
Cool function
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/1999 11:20:00 AM:Russ
Very nicely done! Worked first time! 
With a slight tweak here and there, I 
now have the function working in a .Bas 
module where I can pass any form name 
to the function. Also, using a Type 
declaration and an Enumerated data type 
made it a little tidier.
Anyone 
interested in seeing my changes, feel 
free to e-mail me.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/1999 5:43:00 PM:Gyuri van de Bilt
Hi there,
Indeed really cool piece of 
coding-art.
BUT:
On resizing a window 
that was made transparant (for a small 
part) you won't see more of the window 
than when the 'fMakeATranspArea' 
function was called.
The solution to 
this problem (test it and see) is to 
call the function (with the same param) 
again when resizing the window 
(Form1_Resize()).
It will now work 
perfectly!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/12/1999 5:55:00 AM:Roche Moore
really really excellent
works a 
treat
now, any ideas (good) where to 
use it?!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/12/1999 8:10:00 AM:Joel León Malpartida
it's great code
I'm a peruvian systems 
programmner.
greetings.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/12/1999 10:37:00 PM:Nikhil Acharya
Good Code , Thanks , I have created 
a
Telephone shape form using above 
code
for a dialup application.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/14/1999 8:55:00 AM:Jaw-Breaker
I haven't test it yet. I'm working on a 
hackers control station, I want 
everthing for hacking in one program. I 
think I can really use this to shape up 
the program. 
Jaw-Breaker from 
Noth-Side hackers
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/18/1999 11:30:00 AM:dj277
My teacher makes usdo this vb crap, and 
I know just about jack about it.
Oh, 
Well.
Help!!
I think he's coming!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/18/1999 12:09:00 PM:t30od
I cant seem to get it to work, can 
someone please send me their 
source?
Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/19/1999 2:57:00 AM:Human
COOOL !!!
try it, it works ...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/19/1999 2:14:00 PM:LOGIX
Wow this is some cool code, if any one 
is confused email me and i will explain
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/20/1999 6:26:00 AM:js
CCCCCCCCCCCCCCOOOOOOOOOOOOOLLLLLLLLLLLLL
LLL 
CCCCCCCCCCOOOOOOOOOOOODDDDDDDDDDEEEEEEEE
E
Check this 
site:
http://browse.to/nm
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/21/1999 1:05:00 PM:kinema
Code is wicked ... how can I bitblt 
stuff from invisible picture boxes into 
that transparent area?  That way you 
eliminate the need for screen 
capturing.  
Oh, and I'm looking for 
kewl graphics effects.  
thanks.
listen.to/kinema
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/23/1999 9:46:00 AM:ah Boon
transparent part in form
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/23/1999 9:18:00 PM:cryptic
How do u make it so objects are visible 
if u
on top of the transparent area?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/24/1999 8:26:00 AM:Eric Gaulin
Would it be possible to exclude the 
specified region, so the border of the 
form will be transparent instead?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/24/1999 9:21:00 AM:DAVID PALCZEWSKI -----------
I cant get this to work!  It seems it 
will be awesome, but can someone send a 
example to me. I am using VB 4.0.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/24/1999 11:54:00 PM:Alistair Crawford
Excellent code, worked like a 
charm.
Is there anyway to make the 
transparent area, just transparent and 
not be able to click other applications 
through the hole. I want to make a 
screen capture, draggable cropping 
frame, so users must not be able to 
click the applications inside the 
frame. Please HELP!!!! Anybody.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/25/1999 10:21:00 PM:DarkNemesis
Code Works Great..
Heres my 
situation..
I want to make my entire 
form transparent, but still show an 
image on top ( the image dont go 
transparent ).
Can anyone help me 
with this?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/25/1999 11:40:00 PM:David Ulloa P.
Excellent stuff!!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/26/1999 7:39:00 AM:aluminumblue
nice code.. worked 1st time.. new toy 
for my mind, thanks.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/26/1999 9:41:00 AM:Solomon
Great code! You must have gotten the 
idea from PeepShow (prog that uses this 
feature)...nice translation into VB. 
Thanks!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/26/1999 3:22:00 PM:Sharkero
Great, it work the first time!.. I copy 
the code for step 3 to a command 
button
Command 1 event. Added a button 
to the
form and double clicked it. 
Then I copy 
the code and then REMed 
it out from the 
form. It worked when 
I clicked the button
you have to 
enlarged the form a little 
bit to see 
the hole and then move the form 
around and you will see your code 
or other windows behind it. It is 
cool!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/31/1999 12:48:00 AM:Filip
Superb code, but I cannot run the 
function multiple times for one form, 
because you don't start from the form's 
current region, but from a square 
region with the size of the form.
I 
tried to use the API function 
GetWindowRgn, but I always got 0 for 
the rgn.
I also tried the API 
function CreatePolygonalRgn but could 
not make it work.
Could you try 
it?
PS: Does anyone know how to add 
a menu to the Windows Explorer 
File/Folder right-click dropdown 
menu?
To do something like 
WinZip.
Thanks anyway,
Filip
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/31/1999 3:48:00 AM:Kenny
Great site!!!
I wonder about gettig a 
combobox that
looks like the 
comboboxes for load/save in office97, 
with both drives and folders in the 
same combobox.
Please help me 
someone!!!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/5/1999 8:42:00 PM:-
This code is good.
Anyone know of a 
place where I can get my fat fingers 
something that'll show me ani-gifs.
I 
wanna create a proggie that is like one 
of those message ones....
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/10/1999 4:14:00 PM:HewDude
Cool Script, it should be pointed 
outCool Script, it should be pointed 
out that the last ten or so lines 
should be between "Private Sub 
Form_Load()" and "End Sub" Has anyone 
modified this script to show images or 
buttons infront of the Transparent area 
?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/12/1999 6:09:00 PM:Michael
I got the code to work on the second 
try, but that's ok. I just don't get 
how to make my own shapes, like the one 
guy who make a phone shape. Can someone 
explain to me how to make the different 
shapes?
Email me if you can tell me
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/21/1999 10:38:00 PM:hey
im having trouble with the first word 
in the following part:   "SetWindowRgn" 
hWnd, lNewForm, 
True
Me.Refresh
fMakeATranspArea = 
True
Exit Function
Trap:
MsgBox 
"error Occurred. Error # " & Err.Number 
& ", " & Err.Description
End Function
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/1/1999 10:28:00 AM:DaZZlock
Nåja den är väl ganska bra men jag har 
inte testat den än
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/16/1999 6:11:00 PM:schneider

Be careful when changing region 
while
resizing: the code may run, but 
the compiled may not! -bug I solved a 
few months ago...........
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/17/1999 9:52:00 AM:Jason Petralia
For those of you who can't get this to 
work, here's what you do.  Near the end 
of the code, it says "'3  How to call"  
Put everything above that line in the 
declarations area of your form.  Put 
everything below that line where you 
want the transparency to be activated, 
such as a command button.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/5/1999 12:59:00 PM:mew
this makes the whole thing 
transparent,
even the controls in the 
form..
how can i prevent the controls 
from being transparent 2...;(
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/14/1999 7:49:00 PM:Chris
Very Nice Code, now how can I make an 
image or control show up in front of 
the transparent area?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/25/1999 9:23:00 AM:jaQx
Fun, but cant have other controls 
within transparent area without those 
turning transparent also...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/7/1999 12:14:00 PM:Sure it works... whatever
Could someone just put a plain example 
for usage? something like:
Private 
Sub 
Form_Load()
fMakeATranspArea("RectAngle
", lParam(5, 10, 10, 10))
End 
Sub
that's what I have but it just 
says 'expected ='
I'm not an |diot but 
people really need more documentation 
included with their coding
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/7/1999 4:42:00 PM:Homer
Sure it works... whatever, ill call him 
that or: that guy up there ^. you are 
an |diot(i realize u need the | because 
|diot is innapropriat language?), and 
dont let any one tell you otherwise, 
because thats a horrible HORRIBLE lie. 
u should learn Visual Basics before 
looking up other peoples source code, 
because u wouldnt need extra 
documentation if you knew VB. IM me on 
AOL: homer3685 for help u need with VB, 
in case you want to LEARN it. :) 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/8/1999 4:01:00 PM:Lorenz
Hi! I'm from philippines, and I'd like 
to say nice code! First try it 
works.... but I have a question what is 
lparam(5) and lparam(6) for?..
But 
anyway keep up the good work... thanx..
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/9/1999 3:25:00 PM:AnDroiD
For those who can't run the code here 
is how...
1. Paste all the code in 
general declaration.
2. Create a 
command button.
3. Rename "' 3 How To 
Call" to "Private Sub 
Command1_Click()"
4. Don't forget to 
put an "End Sub" at the last part of 
the code.
There ya go it should work 
now... :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/10/1999 10:22:00 PM:Rob Volk
This Code is SO easy to use... Don't 
know why every1's haveing such a 
problem... BUT, How do I 
place 
objects on top of the transparent part?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/18/1999 9:33:00 PM:Grant
Nice code, and easy! But is there a way 
to make a picture box stay on top? If 
so please email me
-thanks-
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/5/1999 6:04:00 PM:Roger Taylor
This code worked fine using VB 6.0.  
The first time I tried it.
Great code 
no problems.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/6/1999 11:48:00 PM:bugsmalli
Hey there Dalin,
great code. May I 
suggest a simple modification. in the 
declarations section just declare one 
more api call:
Private Declare 
Function SetWindowPos Lib "user32" 
(ByVal hwnd As Long, ByVal 
hWndInsertAfter As Long, ByVal X As 
Long, ByVal Y As Long, ByVal cx As 
Long, ByVal cy As Long, ByVal wFlags As 
Long) As Long
Const HWND_TOPMOST = 
-1
Const HWND_NOTOPMOST = -2
And 
anywhere in the form jus declare this 
sub:
Public Sub FormOnTop(handle As 
Long, ontop As Boolean)
Dim wFlags As 
Long, posflag As Long
wFlags = 
SWP_NOMOVE Or SWP_NOACTIVATE Or 
SWP_NOSIZE Or SWP_SHOWWINDOW
Select 
Case ontop
Case True
 posflag = 
HWND_TOPMOST
Case False
 posflag = 
HWND_NOTOPMOST
End 
Select
SetWindowPos handle, posflag, 
0, 0, 0, 0, wFlags
End Sub
And add 
this piece of line AFTER the call to 
fMakeATranspArea: 
  formonTop 
me.hwnd, true
and see the fun.
have 
fun all,
bugsmalli.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/11/1999 11:31:00 PM:Irman Jamil
You got the target! Nice code. worked 
great.
I think every body should also 
try 
sugestion from bugsmalli
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/5/2000 2:04:42 PM:Tommy
Hi, thanks for the great code!  It 
worked fine creating a hole in my form, 
but I can't figure out what each of the 
 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/5/2000 2:10:29 PM:Tommy
Hi, this code worked fine creating a 
hole in my form, but I can't figure out 
what each of the "lParam()"s do.  I 
can't figure out which one controls the 
top, bottom, left, and right.  If 
anybody could explain what each of the 
1-6 does, I'd greatly eppreciate it.  
Thanks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/16/2002 3:31:52 AM:Richard
Astounding! Great job!  I'm going to 
study this code... you've given me much 
to think about.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.