Sign in to follow this  
Followers 0
dmorand

Unselect item in list after click

8 posts in this topic

I have a menu with 3 lists with various options which a user can select. I want to have the 3 lists setup so that when the user selects the value, it doesn't stay highlighted after they click on it. What ends up happening is the 3 lists all have an item highlighted and it becomes confusing.

How do I go about having the list item not get highlighted when it's clicked?

Share this post


Link to post
Share on other sites



Hi,

Could you try to explain a bit more.. it's confusing what you mean..

posting sample code will help solving your problem better..


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

I have a menu with 3 lists with various options which a user can select. I want to have the 3 lists setup so that when the user selects the value, it doesn't stay highlighted after they click on it. What ends up happening is the 3 lists all have an item highlighted and it becomes confusing.

How do I go about having the list item not get highlighted when it's clicked?

Yep, you need to post some code and a working example for help with your problem. I'm not sure I follow you completely here. Are you saying you have several GUI ListViews and when you select one listview, it automatically highlights the other listviews and this is your problem? Or, are you saying that you are selecting one listview at a time but the highlighted selection is staying for each listview? Or, are you even working with a listview?

This is why example script code is important.


My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

Share this post


Link to post
Share on other sites

Sorry about that, I should have posted some code in the first place.

Here is a snippet of the code I'm working with. I have 3 listviews (app_lst,web_lst,supp_lst).

I'm saying that I'm selecting one listview at a time but the highlighted selection is staying for each listview. I want the selection to not be highlighted after the user selects it.

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=c:\documents and settings\dmorand\desktop\koda\forms\app_launcher.kxf
$Form1_1 = GUICreate("Application Launcher", 488, 471, 242, 128)
$quit_btn = GUICtrlCreateButton("Quit", 248, 416, 233, 49)
$Label1 = GUICtrlCreateLabel("Application Launcher v1.5", 8, 8, 306, 32)
GUICtrlSetFont(-1, 18, 400, 0, "Arial Rounded MT Bold")
$group1 = GUICtrlCreateGroup("Web Applications", 8, 48, 233, 289)
$web_lst = GUICtrlCreateList("", 16, 64, 217, 266)
GUICtrlSetData(-1, "Critical Care - Prod|Critical Care - Test|EDM - Prod|EDM - Test|Soarian Clinicals - Prod|Soarian Clinicals - Test|Soarian Financials - Prod|Soarian Financials - Test")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$help_btn = GUICtrlCreateButton("Information", 248, 352, 233, 49)
$group2 = GUICtrlCreateGroup("Stand Alone Application List", 248, 48, 233, 289)
$app_lst = GUICtrlCreateList("", 256, 64, 217, 266)
GUICtrlSetData(-1, "Admin Desktop - Production|Admin Desktop - Test|Med Administration Check (MAK)|Novius Lab|Syngo WF - Test|Syngo WF - Prod|Pharmacy")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$group3 = GUICtrlCreateGroup("Support Web Sites", 8, 344, 233, 121)
$supp_lst = GUICtrlCreateList("", 16, 360, 217, 97)
GUICtrlSetData(-1, "Electronic Issue Management|Siemens Customer World|Siemens Medical Academy|")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case $app_lst
            $app_run = GUICtrlRead($app_lst)
            $len = StringLen($app_run)
        ;MsgBox(0, "String length is:", $len)
            if($len>0) then
                _launchapp("app")
            endif
        Case $web_lst
            $app_run = GUICtrlRead($web_lst)
            $len = StringLen($app_run)
        ;MsgBox(0, "String length is:", $len)
            if($len>0) then
                _launchapp("web")
            endif
        Case $supp_lst
            $app_run = GUICtrlRead($supp_lst)
            $len = StringLen($app_run)
        ;MsgBox(0, "String length is:", $len)
            if($len>0) then
                _launchapp("supp")
            endif
        case $help_btn()
            Run('notepad \\ISOPS\Analysts\_Application_Launcher\Application_Launcher_help.txt');
    ;Case $launch_btn
    ;   _launchapp()
        Case $quit_btn
            _quitlauncher()
        Exit
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

I would assume I could use the following to uncheck an item on the app_lst list:

$status = GUICtrlSetState($app_lst,$GUI_UNCHECKED)

I tried that, but it didn't uncheck the item I selected

Share this post


Link to post
Share on other sites

$web_lst = GUICtrlCreateList("", 16, 64, 217, 266, $LBS_NOSEL)

Change your lists with the $LBS_NOSEL which won't allow select/highlights of the control but you can still initiate your functions with it. Do that for each of the 3 lists.


My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

Share this post


Link to post
Share on other sites

$web_lst = GUICtrlCreateList("", 16, 64, 217, 266, $LBS_NOSEL)

Change your lists with the $LBS_NOSEL which won't allow select/highlights of the control but you can still initiate your functions with it. Do that for each of the 3 lists.

Sweet that did the job! Thanks for your help.

Share this post


Link to post
Share on other sites

Thats why code is important

Good luck


Best regards,Emiel Wieldraaijer

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