Jump to content
Sign in to follow this  
zellis

Loading A Combo Field From A File.

Recommended Posts

zellis

i have a combo box that i want to have automaticly filled by reading a ini file can some one help?

here is my combo

GUICtrlCreateGroup("Select Sensor Model", 270, 135, 220, 100)
    $sensor_model=          GuiCtrlCreatecombo(" ", 280, 155, 195, 100); makes the combo gui window
                            GUICtrlSetData(-1,"|CA270|CA270V|CA279|CA295|KS127","")

here is my ini file read

FileOpen ($varr, 0); opens the file selected above
                                    If $varr = -1 Then
                                        msgbox(0, "IPU configuration tool ERROR", "Unable to open file. it does not exist. ")
                                        Exit
$sensor_model =         IniRead($varr,"data", "sensor_type", "ERROR, Key not found"); dropdown box value, reads value from file and places it in the variable listed

now the problem is that i do not know what to do from here. please help

endif

Share this post


Link to post
Share on other sites
AutoChris

i have a combo box that i want to have automaticly filled by reading a ini file can some one help?

here is my combo

GUICtrlCreateGroup("Select Sensor Model", 270, 135, 220, 100)
    $sensor_model=          GuiCtrlCreatecombo(" ", 280, 155, 195, 100); makes the combo gui window
                            GUICtrlSetData(-1,"|CA270|CA270V|CA279|CA295|KS127","")

here is my ini file read

FileOpen ($varr, 0); opens the file selected above
                                    If $varr = -1 Then
                                        msgbox(0, "IPU configuration tool ERROR", "Unable to open file. it does not exist. ")
                                        Exit
$sensor_model =      IniRead($varr,"data", "sensor_type", "ERROR, Key not found"); dropdown box value, reads value from file and places it in the variable listed

now the problem is that i do not know what to do from here. please help

endif

You will want to change the variable used to read the INI since it is the same name as the variable used to create the Combobox. Then you need to use GUICtrlSetData($sensor_model, ...) with the new data.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.