Jump to content
Sign in to follow this  
ozbob

GuiCtrlCreateCombo

Recommended Posts

Hi,

Just started to create a GUI and got stuck with the combo box.

I would like to initially enter a value in it, which is then written to a ini file.

On a next occasion it will read the value from the file and show it in a drop list.

If the value is not in the list I would like to enter a new one in the combo list.

Currently when I enter a value in the combo box it returns empty.

What would be the right way of doing this?

Thanks

Share this post


Link to post
Share on other sites

Hi,

Just started to create a GUI and got stuck with the combo box.

I would like to initially enter a value in it, which is then written to a ini file.

On a next occasion it will read the value from the file and show it in a drop list.

If the value is not in the list I would like to enter a new one in the combo list.

Currently when I enter a value in the combo box it returns empty.

What would be the right way of doing this?

Thanks

<{POST_SNAPBACK}>

Post a sample script that's illustrate your problem so we can help you more efficiently.

Thanks :lmao:

Share this post


Link to post
Share on other sites

Maybe something like this:

#include <GuiConstants.au3>

$GUI = GuiCreate("Example")
$combo = GuiCtrlCreateCombo("", 10, 10, 100, 100)
GuiSetState()

While 1
    HotKeyStuff()
    if GuiGetMsg() = $GUI_EVENT_CLOSE Then Exit
Wend
Exit

Func HotKeyStuff()
    If WinActive($GUI) Then
        HotKeySet("{Enter}", "Enter")
    Else
        HotKeySet("{Enter}"
    EndIf
EndFunc

Func Enter()
    $newText = GuiCtrlRead($combo)
    If $newText <> "" Then
        GuiCtrlSetData($combo, $newText);add entry to combo list
        Send("+{Home}{Backspace}");clear the textbox
    EndIf
EndFunc

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Thanks for the help I sorted it out, it was my first time messin with the GUI,

works slightly different than I thinking. My initial question is solved, got stuck with a new issue;

I have listbox containing file names, I would like to be able to drag and drop these to an input box within the script so I am not refering to external files.

Thanks

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...