wuruoyu

GUICtrlCreateInput & GUICtrlCreateEdit borders disappear [Resolved]

15 posts in this topic

#1 ·  Posted (edited)

OS: Win7 (same issue on multiple computers)

Using GUIOnEventMode

Here is how I create the input and edit

 

#NoTrayIcon
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>
#include <GuiTab.au3>
#include <EditConstants.au3>

Opt("GUIOnEventMode", 1)

_main()

Func _main()
    $main = GUICreate("main",368,343,-1,-1,-1,-1)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
    GUICtrlCreateEdit("this is an edit control",23,194,325,67,BitOr($ES_READONLY,$WS_VSCROLL),$WS_EX_CLIENTEDGE)
    GUICtrlCreateInput("This is an inputbox",19,269,325,20,-1,$WS_EX_CLIENTEDGE)
    GUICtrlCreateButton("button",248,303,100,27,-1,-1)
    $tab = GUICtrlCreatetab(4,0,363,186,-1,-1)
    GuiCtrlSetState(-1,2048)
    GUICtrlCreateTabItem("Page 1")
    GUICtrlCreateGroup("Group",14,25,341,150,-1,-1)
    GUICtrlCreateEdit("this is an edit control",20,55,325,67,BitOr($ES_READONLY,$WS_VSCROLL),$WS_EX_CLIENTEDGE)
    GUICtrlCreateInput("This is an inputbox",20,140,325,20,-1,$WS_EX_CLIENTEDGE)
    GUICtrlCreateTabItem("Page 2")
    _GUICtrlTab_SetCurFocus($tab,0)
    GUISetState(@SW_SHOW)
    While 1
        Sleep(100)
    WEnd
EndFunc

Func _exit()
    Exit
EndFunc

 

Reproduce the problem:
1. Launch program
2. Press Win+L to lock computer
3. Unlock computer
4. GUICtrlCreateInput & GUICtrlCreateEdit borders disappear (seems to do that when edit and inputbox controls are inside the tab)

5736e06c5c855_ScreenShot2016-05-14at1.21

Edited by wuruoyu

Share this post


Link to post
Share on other sites



Make a complete runable reproducer script.

Share this post


Link to post
Share on other sites
On May 4, 2016 at 1:21 PM, AutoBert said:

Make a complete runable reproducer script.

Updated with reproducer script. Thanks!

Share this post


Link to post
Share on other sites

wuruoyu,

I cannot reproduce that effect on my machine (Win 7) - the controls are still visible after a lock/unlock cycle.

And is there a reason you use such a convoluted method of adding the controls to your tabitems rather then just creating them immediately after each tabitem is created?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
1 hour ago, Melba23 said:

wuruoyu,

I cannot reproduce that effect on my machine (Win 7) - the controls are still visible after a lock/unlock cycle.

And is there a reason you use such a convoluted method of adding the controls to your tabitems rather then just creating them immediately after each tabitem is created?

M23

Thank you for testing Melba23. I've used ISN AutoIt Studio to create the GUI, and that was how it generates the code. I've updated the reproducer script, it should be much cleaner now. but still having the disappearing border issue... it looks like it's only doing that when controls are inside the tab.

Share this post


Link to post
Share on other sites

wuruoyu,

Still works for me every time.

M23

P.S. When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily.

 


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

anyone else could help me test it on their machine? I've tested on 30 different workstations and all having the same issue. 

Share this post


Link to post
Share on other sites

no problems on win10 x64 with autoit 3.3.14.2

Share this post


Link to post
Share on other sites
1 hour ago, wuruoyu said:

I've tested on 30 different workstations

is it possible that all of those workstations are of the same hardware (or at least the same video card), with the same buggy video driver?

do you get the same issue in safe mode?

Share this post


Link to post
Share on other sites

These are Lenovo ThinkCentre M90p with intel integrated graphic, running x64 or x86 Win7. I doubt there are graphic driver issues as we have over thousands of workstations with the same setup that never experience such issue with any other programs, or programs are created with WPF or Winforms

Share this post


Link to post
Share on other sites

wuruoyu, I can confirm the issue on my old XP. Not on Windows 7. The problem is directly related to the Tab control. It has nothing to do with OnEvent mode. You'll see the same issue in MessageLoop mode. Something on your PCs must provoke the problem. But I don't think you can do anything on the PCs. You have to solve the problem in the AutoIt code.

Generally there may be some small issues associated with using Tab controls. I think this repaint problem is an example. If you move the mouse across the control you'll probably see that the border will be repainted.

An easy workaround is to create the controls in a child window and place the child window on top of the Tab control. Because the controls are created in a real window (and not a Tab control), there will not be any update issues.

If you create a child window for each Tab item you just have to hide the previous child window and show the new child window when you click a Tab item.

Another solution is to force a repaint of the controls when the problem occurs. That's what happens when you move the mouse across the control. But I think this solution is more difficult, and the problem can occur in various situations. The workaround with the child window is a general solution.

Share this post


Link to post
Share on other sites

or avoid using tab controls altogether.

speaking for myself, i find the graphics of the tab control somewhat unaesthetic (although functional). as an alternative, i group my controls in arrays, so i can hide and show them easily. so by clicking a label on the GUI, the user can hide currently visible controls and show a specific group of controls (not to be confused with the "Group" control!), thus achieving the same functionality as using tab control.

Share this post


Link to post
Share on other sites

Thank you LarsJ for pointing me to right direction. I would prefer to go with the force repaint solution.

_WinAPI_RedrawWindow($main)

Calling the above function makes the borders reappear. Is there is way to constantly check if Windows is changed from lock to unlock state? and only call the above function one time when Windows is unlocked.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Thanks again LarsJ, got it working with $EVENT_OPEN_DESKTOP_CHANGED & _WinEventHook_Proc :) cheers

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