473,396 Members | 2,057 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Tricking Transparent Non-Mdi Child Forms into MDI Parent / Application

Hi, I am aware that TransparencyKey only works with top-level forms or
Non-MDI Child Forms, if one tries to set the opacity or
transparencykey property to a MDI-Child form, it will have no effect.

So, I tricked my Transparent Non-MDI Child form into my MDI-Container
form via SetParent API as seen here in my VB.NET sample (
http://wuhenry.beigetower.org/position.zip ).

I thought my problems are over, but apprently, even though I SetParent
the Transparent Non-MdiChild form to the MDI-Container form, the
Non-MdiChild form still retains its .Left & .Top coordinate systems to
Screen Coordinates.

So I tried using the SetForm2Location() function I made and place them
at Form1_Move event, so whenever Form1 moves, Form2 (transparent form)
will move to the same location of Form1.
------------------------------------------
Public Sub SetForm2Location()
If frmForm2 Is Nothing = False Then
Dim p As Point
p = frmForm1.PointToScreen(New System.Drawing.Point(0, 0))

frmForm2.Left = p.X
frmForm2.Top = p.Y

frmForm2.Invalidate()
End If
End Sub
------------------------------------------
**form2 being the Transparent-Non-MdiChild
**form1 being the Mdi-Child

The main goal of my program is to make the Transparent-Non-MdiChild &
Mdi-Child forms to appear as though they are one and the same. Having
the same size & location.

Having the same size for both forms, I use the following code, which
works ok.
------------------------------------------
Public Sub SetForm2Size()
If frmForm2 Is Nothing = False Then
Dim iWidth As Integer
Dim iHeight As Integer

iWidth = frmForm1.Width - (iX_SFrame * 2)
iHeight = frmForm1.Height - (iY_SFrame * 2) -
iCaptionHeight

If frmForm2.Width <> iWidth Or frmForm2.Height <> iHeight
Then
frmForm2.Size = New Size(iWidth, iHeight)
frmForm2.Invalidate()
End If
End If
End Sub
-------------------------------------------
**placing the SetForm2Size at the Form1_Resize event, so whenever
Form1 resizes, Form2 will resize too (same size).
It appears to be when I MAXIMIZE the MDI-Container form, everyting is
appears OK, when I resize the Form1, Form2 resizes, when I move Form1,
Form2 moves on the same place, nice & good.

However, when I DONT maximize the MDI-Container form, location
problems occur. Moving form1 will move form2, but in a different
location, not at the same location of form1.

It appears that when I maximize the MDI-Container form, the coordinate
system becomes screen coordinates???? which made everything work ok.
Any ideas on what might have gone wrong when I don't maximize the
MDI-Container?

Thanks,
Henry
Nov 20 '05 #1
0 4453

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Thomas Wieser | last post by:
Hi, my problem: I have some tables with transparent backgrounds, which are changed in colours within a JavaScript DOM function to have a roll-over effect. Now, i can't get them back...
2
by: Robert Peden | last post by:
Hi All, I have used javascript to chamge a button's image when the mouse moves over the button (graphic) without problems. But I have come upon a new challenge - buttons which overlay each...
4
by: Benny | last post by:
Hello experts, How can i set windows form controls (i.e. button, label, ...etc) to transparent? I tried set the control back colour property to transparent, but it still appear non-transparent....
2
by: Mark Denardo | last post by:
Hi, I need some expert GDI+ person to help me with my RoundOffImage Function: What I'm trying to do is take in an image, crop off the edges around an ellipse region I set up, and then return the...
1
by: Daniel López | last post by:
Hi, I'm trying to create a non rectangular windows form using a PNG image with transparent zones and I want that this zones appears as transparent in the windows form. Before, on VS.NET 2003,...
4
by: Dale | last post by:
I am creating GIF images with transparent backgrounds on-the-fly for a web app and rendering them by using System.Drawing.Image.Save(Response.OutputStream, ImageType.GIF). I am confident that...
1
by: yuban | last post by:
I am trying ( so far in vain ) to display a normal looking ( non-transparent ) control in a transparent window. I am attempting this in C++, on Vista ( argh ), and having no luck at all. Our...
4
by: google | last post by:
My app uses a tab control created in Access 97 and converted to Access 2000 format for clients who have Access 2000, 2003 and 2007. Being created in 97, the control does not have a...
0
by: abc123456 | last post by:
Hello - I'm using imagecopyresample() to resize a GIF line-art type image onto a polygon created with GD_Image in PHP. Each has a transparent color (same color, I think!). The transparent color...
8
by: salmobytes | last post by:
Making thumbnail images isn't all that hard, for the most part. There is lots of shrink-wrapped code out there you can download and/or munge from. But nothing I've yet seen does the right thing...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
tracyyun
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...
0
agi2029
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.