Jump to content
Sign in to follow this  
dok_do

help! autocomplete combo

Recommended Posts

Do you want the combobox to finish something your are typing in it? or..

If so, you could do something like:

#Include <GUIConstants.au3>

GUICreate("GUI",200,200)
$Combo = GUICtrlCreateCombo("",20,20,100,100)    ; you type fx hello


GUISetstate()
While 1
Sleep(20)

If GUICtrlRead($Combo) = "hel" then GUIctrlsetdata($Combo, "Hello")
Wend

Share this post


Link to post
Share on other sites

Or this:

#Include <GUIConstants.au3>

GUICreate("GUI",200,200)
$Combo = GUICtrlCreateCombo("",20,20,100,100)    ; you type fx hello
GUIctrlsetdata($Combo, "Hello1")
GUIctrlsetdata($Combo, "Hello2")
GUIctrlsetdata($Combo, "Hello3")

GUISetstate()
While 1
Sleep(20)

If GUICtrlRead($Combo) = "hel" then GUIctrlsetdata($Combo, "Hello")
Wend

Share this post


Link to post
Share on other sites

Or this:

#Include <GUIConstants.au3>

GUICreate("GUI",200,200)
$Combo = GUICtrlCreateCombo("",20,20,100,100)    ; you type fx hello
GUIctrlsetdata($Combo, "Hello1")
GUIctrlsetdata($Combo, "Hello2")
GUIctrlsetdata($Combo, "Hello3")

GUISetstate()
While 1
Sleep(20)

If GUICtrlRead($Combo) = "hel" then GUIctrlsetdata($Combo, "Hello")
Wend

<{POST_SNAPBACK}>

hmm, thank you

:)

first user makes ini-file , and i will read ini-file.

second, i will fills combo data.(using iniread() )

so, i don't know user inifile.

i want another sample.

Share this post


Link to post
Share on other sites

hmm, thank you

:)

first  user makes ini-file , and i will read ini-file.

second, i will  fills combo data.(using iniread() )

so, i don't know user inifile.

i want another sample.

<{POST_SNAPBACK}>

hmm, you have to be more specific... i understand that you want to set the data of the inifile to the combobox, but why? and what data...

Share this post


Link to post
Share on other sites

hmm, you have to be more specific... i understand that you want to set the data of the inifile to the combobox, but why? and what data...

<{POST_SNAPBACK}>

i want to make autocomplete like scite autocomplete and Abbreviations

it is very useful. so i will make it.

hmm, my english is very poor :)

do you understand? :D

Share this post


Link to post
Share on other sites

i want to make autocomplete like scite autocomplete and Abbreviations

it is very useful. so i will make it.

hmm, my english is very poor  :)

do you understand?  :D

<{POST_SNAPBACK}>

Yeah i do :D but i don't understand were the words it compares with should come from?.. you are talking about something with a ini file..?

Share this post


Link to post
Share on other sites

Yeah i do  :)  but i don't understand were the words it compares with should come from?.. you are talking about something with a ini file..?

<{POST_SNAPBACK}>

1. i will make autocomplete combo

2. i will send program to my friend.

3. friend makes inifile

ex)

[key]

abc=def

ai=atoit

btw=by the way

......

4. program will read inifile.

5. friend hits alphabet 'b' and it appear combo.

i don't know inifile data. so, i don't use GUICtrlRead($Combo) = "hel"

Share this post


Link to post
Share on other sites

If i understand it right, it would be something like this:

#Include <GUIConstants.au3>

GUICreate("GUI",200,200)
$Combo = GUICtrlCreateCombo("",20,20,100,100)   ; you type fx hello

Iniwrite("Names.ini","Shortnames","hel","Hello")
Iniwrite("Names.ini","Shortnames","au","AutoIt")
Iniwrite("Names.ini","Shortnames","abc","def")
Iniwrite("Names.ini","Shortnames","btw","by the way")

$IniRead = IniReadSection("Names.ini", "Shortnames")



GUISetstate()
While 1
Sleep(10)
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit


For $i = 1 To $IniRead[0][0]
        If GUIctrlRead($Combo) = $IniRead[$i][0] Then 
            $Read = IniRead("Names.ini","Shortnames",GUICtrlRead($Combo),"NotFound")
            GUIctrlsetdata($Combo, $Read)
        EndIf 
Next

Wend
Edited by Wb-FreeKill

Share this post


Link to post
Share on other sites

If i understand it right, it would be something like this:

#Include <GUIConstants.au3>

GUICreate("GUI",200,200)
$Combo = GUICtrlCreateCombo("",20,20,100,100)  ; you type fx hello

Iniwrite("Names.ini","Shortnames","hel","Hello")
Iniwrite("Names.ini","Shortnames","au","AutoIt")
Iniwrite("Names.ini","Shortnames","abc","def")
Iniwrite("Names.ini","Shortnames","btw","by the way")

$IniRead = IniReadSection("Names.ini", "Shortnames")
GUISetstate()
While 1
Sleep(10)
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
For $i = 1 To $IniRead[0][0]
        If GUIctrlRead($Combo) = $IniRead[$i][0] Then 
            $Read = IniRead("Names.ini","Shortnames",GUICtrlRead($Combo),"NotFound")
            GUIctrlsetdata($Combo, $Read)
        EndIf 
Next

Wend

<{POST_SNAPBACK}>

Oh, Wb-FreeKill

Thank you. you are very kind and smart man. :)

Share this post


Link to post
Share on other sites

Oh, Wb-FreeKill 

Thank you. you are very kind and smart man. :D

<{POST_SNAPBACK}>

Kind yes, smart.. hmm in my own opinion, yes :)

Well no problem...

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...