473,545 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Positioning Non-Child to same position of Child MDI

Hi,.. I have 2 forms with the same width & height, one with 100
opacity and the other with 50% opacity. Since I'm in an MDI
application, the form with the 50% opacity cannot be a MDI Child or
else the Opacity function will not work. My main objective is to
position both forms in the same location. Now since one form is a
non-child form (again, for opacity to work), and the other is a
mdi-child form, how do I go about positioning them in the same place?

I tried doing a NonChild.Left = ChildMdi.Left & NonChild.Top =
ChildMdi.Top , but it renders a different position. It seems to me
that the Top & Left values of the MDI is based on the Parent's MDI
workspace, while the NonChild's Top & Left value is based on the
Desktop's workspace.

Is there anyway around this? It would be easier if the opacity
function works on a MDIChild form. Yes?

Thanks,
Henry
Nov 20 '05 #1
2 1333
Since the MDI Child Coordinates are with reference of the MDI Parent, that
is the reason why u can't map them. Try the following instead.

NonChild.Left = Child.Left + MDI.Left
NonChild.Top = Child.Top + MDI.Top

Thank You,
RawCoder

"Henry Wu" <he***********@ hotmail.com> wrote in message
news:86******** *************** **@posting.goog le.com...
Hi,.. I have 2 forms with the same width & height, one with 100
opacity and the other with 50% opacity. Since I'm in an MDI
application, the form with the 50% opacity cannot be a MDI Child or
else the Opacity function will not work. My main objective is to
position both forms in the same location. Now since one form is a
non-child form (again, for opacity to work), and the other is a
mdi-child form, how do I go about positioning them in the same place?

I tried doing a NonChild.Left = ChildMdi.Left & NonChild.Top =
ChildMdi.Top , but it renders a different position. It seems to me
that the Top & Left values of the MDI is based on the Parent's MDI
workspace, while the NonChild's Top & Left value is based on the
Desktop's workspace.

Is there anyway around this? It would be easier if the opacity
function works on a MDIChild form. Yes?

Thanks,
Henry

Nov 20 '05 #2
> NonChild.Left = Child.Left + MDI.Left
NonChild.Top = Child.Top + MDI.Top


Hi, I've done that but I'm having problems with things like menu,
borders, frames etc..

I made the following code below that makes the 2 forms positioned
perfectly in the same location.

However, here...
----------------------------------
Me.Left = mdiVideoInspect ionGlobal.Left + iX_Border +
frmVideoPreview Global.Left + 2

Me.Top = mdiVideoInspect ionGlobal.Top + iCaptionHeight + iY_Menu +
frmVideoPreview Global.Top + iY_Border + 2
----------------------------------
Above is part of the code shown below, as you can see there is a plus
2 on both Me.Left & Me.Top, the plus 2 on both is critical for they
make the two forms positioned at the same location with each other.

With you have any clue on what the plus 2 are?

Here is a description of my application:

Title/Caption Bar
Single Menu Bar
B
O MDI-CHILD FORM
R
D
E
R

O
F

M
D
I


Code:
--------------------------------------------
Dim Left As Integer
Dim Top As Integer
Dim iCaptionHeight As Integer
Dim iX_Border As Integer
Dim iY_Border As Integer
Dim iY_Menu As Integer

Debug.WriteLine (GetSystemMetri cs(SM_CXBORDER) ) '1 'The width
and height, in pixels, of a window border.
Debug.WriteLine (GetSystemMetri cs(SM_CYBORDER) ) '1 'The width
and height, in pixels, of a window border.
Debug.WriteLine (GetSystemMetri cs(SM_CXFRAME)) '4
'Thickness, in pixels, of the sizing border around the perimeter of a
window that can be resized.
Debug.WriteLine (GetSystemMetri cs(SM_CYFRAME)) '4
'Thickness, in pixels, of the sizing border around the perimeter of a
window that can be resized.
Debug.WriteLine (GetSystemMetri cs(SM_CYMENU)) '19 'Height,
in pixels, of single-line menu bar.
Debug.WriteLine (GetSystemMetri cs(SM_CYCAPTION )) '19 'Height,
in pixels, of normal caption area.

iCaptionHeight = GetSystemMetric s(SM_CYCAPTION)
iX_Border = GetSystemMetric s(SM_CXFRAME)
iY_Border = GetSystemMetric s(SM_CYFRAME)
iY_Menu = GetSystemMetric s(SM_CYMENU)

Me.Left = mdiVideoInspect ionGlobal.Left + iX_Border +
frmVideoPreview Global.Left + 2
Me.Top = mdiVideoInspect ionGlobal.Top + iCaptionHeight +
iY_Menu + frmVideoPreview Global.Top + iY_Border + 2
Nov 20 '05 #3

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

Similar topics

9
32031
by: Bryan R. Meyer | last post by:
Hello Everyone, The problem of browser resizing has become an issue for me. While redesigning my webpage, I set the left and right margins to be auto so that my content would be centered. However, there are images that I used absolute positioning in order to place them in the appropriate location on my page. When I do a browser resize,...
1
4841
by: Jörg Ellermann | last post by:
Hi, I have a long table with flexible column width. Now want to make the first row (containing column titles) sticky by absolute CSS positioning so that it remains visible while the following rows scroll. I cannot split the table because then the column width would not match.
36
4083
by: Jack Hughes | last post by:
This argument has come up two or three times lately. We have a web standards document at our company that say "Use valid HTML 4; We don't recommend switching to DIV-based CSS-P for layout just yet though, tables are a lot easier." That's because we have a lot of developers who aren't ready to move to CSS-P and DIVs just yet. But I'm...
4
2690
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here: http://www.wpdfd.com/editorial/wpd0103.htm#toptip (the second example) The problem is, under the image is a large table. But using the above positioning, now the...
8
42510
by: Asad | last post by:
Hi, I am basically trying to accomplish drop down menus for navigation on a site. And I'm pretty much done except I am having one problem. The z-index is not working with relative positioning! Basically I have a page such as this: http://members.rogers.com/asadkhan2/prob2.jpg
1
6329
by: Mr.Clean | last post by:
I'm having trouble with this. The checkbox is no where near where it is supposed to be and the radio button is not at 206 px away from the left of the window. Looks bad in IE6, even worse in Firefox1.0. I tried using <label> tags but they didn't come out right either. Need the class xxxx_Label because I may be having the text to the left...
0
861
by: Markus Rytterkull | last post by:
Hi! Is it possible to control where controls that are not visible (datasource etc) are positioned in design view? I'm using masterpages with two contentplaceholdes (they alone make the page almost unreadable) and when adding a datasourcecontrol which places it self in the upper lefter corner of my page, it is very difficult to see my other...
5
1869
by: aljamala | last post by:
Hi, I have a group of 5 tables laid out of the web page. 2 go on the left side and 3 on the right. These tables retrieve data from the database so the number of records (rows) returned varies. So the problem I am having at the moment is that if the table gets longer by one or two rows, all my alignment goes of out whack for the other...
5
2397
by: Howard | last post by:
I have seen a lot of examples of 2 & 3 Collumn layout schemes. But I have not yet found any examples for positioning images and centering them by the browser. I notice that there are CSS properties for Left and Right, but not for Centering. So my question is How does one center an image to the Browser window? I was thinking about...
1
2212
by: final farewell | last post by:
Hello, I am using Ekhau Location Tracking System for an assignment. It is a system that is able to track configured tags attached to people or objects. I am new to the Ekahau Location Tracking System, but I have quite a good idea how it works. I have an assignment to develop a real application using the Ekahau Positioning Engine (The Engine...
0
7478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7410
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7668
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7923
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7437
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7773
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3466
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.