Sign in to follow this  
Followers 0
E1M1

Cant use GUICtrlCreatePic on tab

4 posts in this topic

Hi.

I Found that I cant use GUICtrlCreatePic on tab, but it works perfectly without tab. I need to display image on tab item but I cant find explanation to my problem. If anyone would be so nice and help me out, I certainly appreciate that.

Why I dnon't see image with this code?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Firma andmed", 419, 389, 192, 114)
$tab = GUICtrlCreateTab(0, 0, 400, 380)
GUICtrlCreateTabItem("tab1")
GUICtrlCreateLabel("txt", 20, 20, 20, 20)
$Pic1 = GUICtrlCreatePic(@ScriptDir & "\bk.bmp", 152, 88, 100, 100, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

But see with this?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Firma andmed", 419, 389, 192, 114)
$Pic1 = GUICtrlCreatePic(@ScriptDir & "\bk.bmp", 152, 88, 100, 100, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Thanks In advance


edited

Share this post


Link to post
Share on other sites



Its $WS_CLIPSIBLINGS problem, you put picture behinde tab. set tab sized to smaller and youl see picture behinde tab ^^


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

This, from the helpfile (GUICtrlCreatePic) may assist,

If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control and create it after the others controls: GuiCtrlSetState(-1,$GUI_DISABLE). This is not enough for Tab or Listview control which behave differently. In this case you need to create the picture with the $WS_CLIPSIBLINGS style, GuiCtrlSetState(-1,$GUI_ONTOP) is necessary for the Tab, TreeView or Listview control.

edit: well I was a bit slow, but at least I was thinking right..

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Thank you verymuch.


edited

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