Jump to content
rizaado

Function GUICtrlGetSize

Recommended Posts

rizaado
Func GUICtrlGetSize($iControlID)
    Local $hControlID = GUICtrlGetHandle($iControlID)
    Local $aControlPos[2]
    $aControlPos[0] = ControlGetPos($hControlID, "", 0)[2] ;width
    $aControlPos[1] = ControlGetPos($hControlID, "", 0)[3] ;height
    Return $aControlPos
EndFunc ;==>GUICtrlGetSize

Purpose: Get the width and height of control.

My Purpose: Get the width and height of images(controls).

Edited by rizaado

Share this post


Link to post
Share on other sites
rizaado

I haven't just run tidy. I am going to edit the post.

Before edit:

Func GUICtrlGetSize($iControlID)
    Local $hControlID = GUICtrlGetHandle($iControlID)
    Local $aControlPos[2]
    $aControlPos[0] = ControlGetPos($hControlID, "", 0)[2]
    $aControlPos[1] = ControlGetPos($hControlID, "", 0)[3]
    Return $aControlPos
EndFunc   ;==>GUICtrlGetPos

 

Share this post


Link to post
Share on other sites
rizaado

Divide GUICtrlGetSize into two functions - "getWidth" and "getHeight"! It is better solution.

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

×