Jump to content

Refreshing pictures makes sunken control bigger?


Recommended Posts


I just discovered something strange. Don't know, if it's a bug or just me missing a piece.

When I update a picture control (GUICtrlCreatePic with $SS_SUNKEN style) with the same or a different picture over and over again, the picture control gets bigger! ;)

Without $SS_SUNKEN, it doesn't. Why is that?

Here's a example to demonstrate it.

Put a jpg file named 'pic.jpg' in @ScriptDir or use the attached one. *


#include <GuiConstants.au3>
#include <StaticConstants.au3>

Opt("GuiOnEventMode", 1)

GUICreate("Pic test?", 800, 360)
GUISetOnEvent($gui_event_close, "quit")

GUICtrlCreateLabel("NOT sunken", 10, 4, 380, 16, $ss_center)
GUICtrlCreateLabel("Sunken!", 410, 4, 380, 16, $ss_center)

$pic1 = GUICtrlCreatePic("", 10, 20, 380, 285)
$pic2 = GUICtrlCreatePic("", 410, 20, 380, 285, $ss_sunken)

$btn = GUICtrlCreateButton("Refresh picture", 10, 320, 185, 30)

GUICtrlSetOnEvent($btn, "showPic")

While True

Func showPic()
    GUICtrlSetImage($pic1, "pic.jpg")
    GUICtrlSetImage($pic2, "pic.jpg")

Func quit()


* Sorry, if I made you hungry, I just had this one nearby. :evil:


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

  • Recently Browsing   0 members

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