Jump to content

Auto-Resize discrepancy


Recommended Posts

Whenever I size a text box to the size of the window to be auto-resized later, why must I define two heights (one for Windows XP and one for XP classic and older OSes) ?

If @OSVersion = "WIN_XP" Then
    $txtMain = GUICtrlCreateEdit("",1,1,400,293)
Else
    $txtMain = GUICtrlCreateEdit("",1,1,400,300)
EndIf

This is what I have to do with the code; of course, if someone is using Windows XP classic mode, then the window appears improperly. What can I do to ensure that the text box is always the same size as the inside of the window?

Link to comment
Share on other sites

Thank you, this works! I finally figured this out, can't wait to implement it now. (I've never actually seen this before, and I've been through two versions of VB before I found AutoIt...)

#include <GUIConstants.au3>

$gui = GUICreate("my gui",400,300)
$size = WinGetClientSize($gui)
$label = GUICtrlCreateEdit("",0,0,$size[0],$size[1])

GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
        
WEnd
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...