Jump to content
Sign in to follow this  
BoonPek

Resizing GUI elements

Recommended Posts

BoonPek

Hello there!

It has been some time since I last posted here, lol :)

So yes, back to topic! Is there a way to lock the height of an object in direct relation with the GUI size - not using percentages, but pixels instead? I've experimented with GUICtrlSetResizing() but it doesn't seem to fully do what I want accomplished (it works horizontally, not vertically).

This is what the code below looks like normally:

Posted Image

And how it looks like when resized vertically:

Posted Image

#include <GuiConstantsEx.au3>
#include <IE.au3>

GUICreate("Launcher", 854, 480, -1, -1, 0x16CF0000, 0x00000100)

Global $oIE = ObjCreate("Shell.Explorer.2")

GUICtrlCreateObj($oIE, 0, 0, 854, 380)
GUICtrlSetResizing(-1, 1)

GUICtrlCreateButton("BIG BUTTON", 0, 380, 854, 100)

$oIE.navigate("about:blank")
$oIE.document.body.style.border = "0"
$oIE.document.write("<body style='border:0;margin:0px'><iframe frameborder=0 src =http://autoitscript.com/forum/ width=100% height=100%></iframe></body>")

$oIE.refresh
$oIE.document.body.scroll = "no"

GUISetState()

Do
    Sleep(10)
Until GUIGetMsg() = $GUI_EVENT_CLOSE

I'd like it to look like this:

Posted Image

I've experimented with different values of GUICtrlSetResizing() but to no avail. There are other ways, I know, such as manually resetting the size of the elements - but they seem rather inefficient. Any input would be considered and appreciated!

Thanks in advance,

Boon.


Share this post


Link to post
Share on other sites
taietel

!:

#include <GuiConstantsEx.au3>
#include <IE.au3>

GUICreate("Launcher", 854, 480, -1, -1, 0x16CF0000, 0x00000100)

Global $oIE = ObjCreate("Shell.Explorer.2")

GUICtrlCreateObj($oIE, 0, 0, 854, 380)
GUICtrlSetResizing(-1, 102)

GUICtrlCreateButton("BIG BUTTON", 0, 380, 854, 100)
GUICtrlSetResizing(-1, 582)
$oIE.navigate("about:blank")
$oIE.document.body.style.border = "0"
$oIE.document.write("<body style='border:0;margin:0px'><iframe frameborder=0 src =http://autoitscript.com/forum/ width=100% height=100%></iframe></body>")

$oIE.refresh
$oIE.document.body.scroll = "no"

GUISetState()

Do
    Sleep(10)
Until GUIGetMsg() = $GUI_EVENT_CLOSE

?

Share this post


Link to post
Share on other sites
BoonPek

Exactly what I needed! Thanks, and sorry for the late reply ._.


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×