Jump to content

Recommended Posts

Posted

Hi,

when I place a label as a color surface above a listview, a button or an input the label partly disappears. Example:

#include <GUIConstantsEx.au3>

Example()

Func Example()
    GUICreate("Label Test", 220, 300, 100, 200)
    GUISetBkColor(0x00E0FFFF)

    Local $idListview = GUICtrlCreateListView("col1  |col2|col3  ", 10, 10, 200, 150)
    GUICtrlCreateListViewItem("item1|col12|col13", $idListview)
    GUICtrlCreateListViewItem("item2|col22|col23", $idListview)
    GUICtrlCreateButton("Value?", 20, 170, 180, 25)
    GUICtrlCreateInput("", 20, 205, 180, 25)
    GUICtrlCreateLabel("This is a testThis is a testThis is a testThis is a test", 20, 240, 180, 30)
    GUICtrlSetBkColor(-1, 0x00FF00)
    GUISetState(@SW_SHOW)

    GUICtrlCreateLabel("", 5, 5, 105, 290) ; that should be the topmost item in the gui
    GUICtrlSetBkColor(-1, 0xFF0000)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>Example

The red label should cover half of the gui. But right a start the listview is excluded:

Label-Test_at-Start.PNG.dda754877417d4cc76a3c4bc3236b087.PNG

And after hovering over button and input even there the red label vanishes:

Label-Test_after-Hover.PNG.ad78579c90603fa2b9544729e7e3852d.PNG

The green label always stays behind the red one. What is the reason for this behavior and how to change this?

Regards, Conrad

SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win_10   Build = 19044   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Posted

I don't know what is the purpose of this, but here is a solution ( if I understood you correct).

 

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

Example()

Func Example()
    Local $hMain = GUICreate("Label Test", 220, 300, 100, 200)

    Local $hChild1 = GUICreate("SubWindow1", 105, 290, 5, 5, $WS_CHILD, $WS_EX_TOPMOST, $hMain)
    GUISetBkColor(0xFF0000)
    GUISetState(@SW_SHOW)


    Local $hChild2 = GUICreate("SubWindow2", 220, 300, 0, 0, $WS_CHILD, -1, $hMain)
    GUISetBkColor(0x00E0FFFF)

    Local $idListview = GUICtrlCreateListView("col1  |col2|col3  ", 10, 10, 200, 150)
    GUICtrlCreateListViewItem("item1|col12|col13", $idListview)
    GUICtrlCreateListViewItem("item2|col22|col23", $idListview)
    GUICtrlCreateButton("Value?", 20, 170, 180, 25)
    GUICtrlCreateInput("", 20, 205, 180, 25)
    GUICtrlCreateLabel("This is a testThis is a testThis is a testThis is a test", 20, 240, 180, 30)
    GUICtrlSetBkColor(-1, 0x00FF00)

    GUISetState(@SW_SHOW)

    GUISwitch($hMain)
    GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>Example

 

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

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
×
×
  • Create New...