Sign in to follow this  
Followers 0
RobertKipling

Auto-Resize discrepancy

4 posts in this topic

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?

Share this post


Link to post
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

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  
Followers 0