In VB6 , is it possible to have the form invisible but the things inside it visible?
8 11696
In VB6 , is it possible to have the form invisible but the things inside it visible?
You have to use windows api in VB6:
Declarations: -
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
-
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
-
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
-
Private Const GWL_EXSTYLE = (-20)
-
Private Const WS_EX_LAYERED = &H80000
-
Private Const LWA_ALPHA = &H2&
-
Using the api: -
Dim bytOpacity As Byte 'Set the transparency level
-
bytOpacity = 128
-
Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
-
Call SetLayeredWindowAttributes(Me.hwnd, 0, bytOpacity, LWA_ALPHA)
-
finally, restoring the windows opacity; -
Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) And (Not WS_EX_LAYERED))
-
Reference: http://articles.techrepublic.com.com...-5031805.html#
You have to use windows api in VB6:
Declarations: -
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
-
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
-
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
-
Private Const GWL_EXSTYLE = (-20)
-
Private Const WS_EX_LAYERED = &H80000
-
Private Const LWA_ALPHA = &H2&
-
Using the api: -
Dim bytOpacity As Byte 'Set the transparency level
-
bytOpacity = 128
-
Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
-
Call SetLayeredWindowAttributes(Me.hwnd, 0, bytOpacity, LWA_ALPHA)
-
finally, restoring the windows opacity; -
Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) And (Not WS_EX_LAYERED))
-
Reference: http://articles.techrepublic.com.com...-5031805.html#
I've used that method before, but is it possible to make the Form transparente while the controls in it are not?
That'll be really cool
I've used that method before, but is it possible to make the Form transparente while the controls in it are not?
That'll be really cool
I see what you mean. That would be cool.
I dont know of any quick way.
Although, if your desktop is black, you could simply make your form black.
Another idea is to make your visible controls become forms themselves (make the form borderless and the same size as the visible control) and layer them on top of the transparent form. Thats alot of form tracking though.
Anyway, good luck with it.
Thanks guys ,but
1) I'd tried the Control-is-a-form method before posting here...But what if you have a circle shape?I Doubt you can have circular forms...
2) I'll try the API Functions Later...
3) <Not Related : How do you add bytes?>
1) I'd tried the Control-is-a-form method before posting here...But what if you have a circle shape?I Doubt you can have circular forms...
I think you can. I've seen a demo of a circular clock or something, which was done just to show off differently-shaped windows. Try a quick search for expressions like "round clock". It may have even been mentioned previously on TheScripts, so you can try our search box up the top.
2) I'll try the API Functions Later...
3) <Not Related : How do you add bytes?>
To what?
By the way, one way you might be able to simulate a transparent form is by taking a snapshot of the screen before displaying your form (standard stuff when writing a screensaver) then paint that picture (appropriately positioned) onto your form.
Oh, one other thing. I didn't read the code form that link (don't have time) but is it possible that it could be applied to one or more controls? That is, set the form to transparent, then set control(s) to non-transparent?
Set the form to invisible and the controls visible
Pre-Tried,Useless
Nothing found " Round forms";"Circular Forms"
Thank you <:TOPIC SOLVED:> Sign in to post your reply or Sign up for a free account.
Similar topics
by: Cecile Muller |
last post by:
I've been trying to just open a png and display it, that way:
<?
header ("Content-type: image/png");
$im = imagecreatefrompng('empty.png');
imagepng($im);
?>
But the transparency is not...
|
by: Piotr Wolski |
last post by:
how to make my page that it was correct with every browser standard?
for example when i change HTML's table size it has no effect when i see
it under mozilla and has effect under Internet...
|
by: Matthias Czapla |
last post by:
Hi!
I want to resize uploaded GIF images. Currently I do it like this:
<?php
// ...
$img = imagecreatefromgif($path);
$img_scaled = imagecreate($new_width, $new_height);...
|
by: Robin Becker |
last post by:
Has anyone done transparency with PIL & TIFF? I'm using PIL to generate
a preview TIFF for embedding into an eps file and am being asked for the
TIFF to support transparency.
--
Robin Becker
|
by: Mr. x |
last post by:
Hello,
I would like that my image's background color will be transparent.
What I have is only paintbrush.
My image is *.jpg format (I have tried to save it as *.gif format, and I got
less...
|
by: Nathan Sokalski |
last post by:
I am trying to create graphics with GDI+ that include transparency. However,
the transparency never seems to show up, even though my colors have an alpha
value of 0. How can I generate a graphic...
|
by: tommaso.gastaldi |
last post by:
In a previous post I have been asking about a way to test Alpha
Transparency.
Bob and Michael have kindly provided some ideas.
Here I would like to share the function I have prepared, for the...
|
by: ZikO |
last post by:
Hi.
I've experienced one problem. Im using three froms. Two of them are
maximized, whereas one is normal form with transparency. Transparency stops
working, that is I can see the color which...
|
by: dragze |
last post by:
Hi,
On one of the pages of my site i use two javascripts, one makes transparency of png's work in IE, and the other embeds a flash player.
Now use one of the scripts it works fine, use both and...
|
by: Martijn Mulder |
last post by:
When I populate a ToolStrip with ToolStripButtons with a .png-image on
it, will Windows understand the transparency of the .png file?
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |