AutoHotkey Community

It is currently May 27th, 2012, 12:12 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: April 25th, 2011, 11:23 pm 
Offline

Joined: May 15th, 2007, 8:59 pm
Posts: 169
Is it possible to bring a control on top of other.

For example:
Code:
gui, add, edit, x10 y10 w100 h20, Control1
gui, add, edit, x10 y10 w200 h20, Control2
gui, show


If I want to make Control2 to stay on top of control1.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 25th, 2011, 11:55 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Your question doesn't make sense to me.

When you write "top", which dimension are you referring to?

Some refer to "top" as the y position further from the floor
Some refer to "top" as z-order, so the iterm covers another control

I have changed you script to show that the 2nd control is layered on top of the first.

Code:
gui, add, edit, x10 y10 w100 h100, Control1
gui, add, edit, x50 y50  w200 h20, Control2
gui, show


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 26th, 2011, 2:26 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
I know of 3 ways to keep one control drawn on top of another (and still be part of the same gui).

First is to redraw the upper control immediately whenever the bottom control is redrawn, you can do this by monitoring the WM_NOTIFY message.

Second is to use SetParent to make the upper control a child of the lower control.

Third is to use WinSet, Region, to cut a 'hole' in the lower control to allow the upper control to show through, regardless of what order they're redrawn in. (Also, setting controls' display regions can produce effects like graphically joining separate edit controls).

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 26th, 2011, 6:20 pm 
Offline

Joined: May 15th, 2007, 8:59 pm
Posts: 169
Yes, sorry I am talking about their zindexing.

Thanks VxE, I will try out these techniques and see which one works best in my situation.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, Yahoo [Bot] and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group