Jump to content

Control borders disappear when inside Tab controls


telmob
 Share

Recommended Posts

I've been noticing for the last days that after a few minutes my GUI is left unattended, the borders disappear in all showing ListViews. I thought it was only when the app was not compiled, but it happens with Koda, and on the script itself, compiled or not. I then need to minimize/restore the window for the listview to show normally again.

I'm on Windows 11. Not sure if that's part of the issue.

The pics attached are self-explanatory.

Any idea how to fix this? Or am i the only one with this problem? I tried searching the forum, but nothing came up.

Koda bugged:

image.png.90754fe856ad50f065c23bb16a812803.png

Script bugged:

image.png.16e50dca2ece7f447944c126467561b9.png

Normal:

image.png.890aaf8c7db8db6ff2ff95b6ca214608.png

Example List from my script:

$ListPag = GUICtrlCreateListView("ID|Data|NºColab.|Nome|Pago", 632, 152, 426, 174)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 1)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 120)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 70)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 110)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 70)
    _GUICtrlListView_JustifyColumn(GUICtrlGetHandle($ListPag), 1, 2)
    _GUICtrlListView_JustifyColumn(GUICtrlGetHandle($ListPag), 2, 2)
    _GUICtrlListView_JustifyColumn(GUICtrlGetHandle($ListPag), 4, 2)
    _GUICtrlListView_HideColumn ( $ListPag, 0)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_LV_ALTERNATE)

Edit: Just found out that this is an old problem, maybe even an old bug, but i also haven't seen any recent updates. Changed the title to a more appropriate one.

Edited by telmob
Link to comment
Share on other sites

Just wanted to add that all my ListViews are inside Tab controls. I just wanted to share this, because i found a similar issue on the forum. 

Edit: Just found out that this 'bug' happens when Windows is locked for some time. Not sure if it happens in other situations.

Anyway, i managed to get past this problem using the script from KaFu:

Just edited it to refresh my GUI when the screen is unlocked, with _WinAPI_RedrawWindow($GUI), which requires #include <WinAPIGdi.au3> btw.

I will not mark this as solved for now, because i still think it's a bug, but hey, it's working :)

Edited by telmob
Found a bypass
Link to comment
Share on other sites

  • telmob changed the title to Control borders disappear when inside Tab controls

Hi,

 

I just updated to 3.3.16.0, and found an issue that may be related to this one. The borders of a combo box inside a tab item disappear as soon as the contents is updated using GUICtrlSetData after the tabitem structure has been closed. Here is a short example script:

; combo box inside tab
Local $hTestGUI = GUICreate("ComboBoxTest", 300, 100)
Local $hTestTab = GUICtrlCreateTab(-1, -1, 260)
Local $hTestItem = GUICtrlCreateTabItem("test")
Local $hTestCombo = GUICtrlCreateCombo("test1", 20, 25, 120)
GUISetState(@SW_SHOWNORMAL, $hTestGUI)
GUICtrlSetData($hTestCombo, "test1|test2|test3", "test2")
GUICtrlCreateTabItem("")
GUICtrlSetData($hTestCombo, "|test1|test2|test3", "test1")

MsgBox(0, "Waiting", "Click OK to close window")
Exit

In AutoIt 3.3.16.0 the combo box border is invisible:

grafik.png.5f0c9d2e57fce4b48fecad9df2d0e1ab.png

However, it appears as soon as the mouse is moved over it.

If the script is run in AutoIt 3.3.14.5 or the line

GUICtrlSetState($hTestCombo, 16)

is added after the second GUICtrlSetData line, the border is restored. This is what I expect it to look like:

grafik.png.476a88c97249607dba85ee7664728b5f.png

Link to comment
Share on other sites

1 hour ago, Mandos said:

Hi,

 

I just updated to 3.3.16.0, and found an issue that may be related to this one. The borders of a combo box inside a tab item disappear as soon as the contents is updated using GUICtrlSetData after the tabitem structure has been closed. Here is a short example script:

; combo box inside tab
Local $hTestGUI = GUICreate("ComboBoxTest", 300, 100)
Local $hTestTab = GUICtrlCreateTab(-1, -1, 260)
Local $hTestItem = GUICtrlCreateTabItem("test")
Local $hTestCombo = GUICtrlCreateCombo("test1", 20, 25, 120)
GUISetState(@SW_SHOWNORMAL, $hTestGUI)
GUICtrlSetData($hTestCombo, "test1|test2|test3", "test2")
GUICtrlCreateTabItem("")
GUICtrlSetData($hTestCombo, "|test1|test2|test3", "test1")

MsgBox(0, "Waiting", "Click OK to close window")
Exit

In AutoIt 3.3.16.0 the combo box border is invisible:

grafik.png.5f0c9d2e57fce4b48fecad9df2d0e1ab.png

However, it appears as soon as the mouse is moved over it.

If the script is run in AutoIt 3.3.14.5 or the line

GUICtrlSetState($hTestCombo, 16)

is added after the second GUICtrlSetData line, the border is restored. This is what I expect it to look like:

grafik.png.476a88c97249607dba85ee7664728b5f.png

Thanks @Mandos! It appears to be the case. It seems to be an old issue. Let's hope it solved eventually :)

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
 Share

  • Recently Browsing   0 members

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