Sign in to follow this  
Followers 0
LeHuynhNam

problem with combobox!

8 posts in this topic

#1 ·  Posted (edited)

I have a combo box like this:

$HomeDrive = @HomeDrive
$1 = StringLeft($HomeDrive, 1)
$input1 = GUICtrlCreateCombo ($1, 288, 185, 52, 21,0x2042,-1)
_GUICtrlComboBox_LimitText($input1,1)

Global $odd = DriveGetDrive ("all")
For $i = 1 To $odd[0]
    $result = StringTrimRight($odd[$i], 1)  
GUICtrlSetData ($input1, $result, $odd[1])
Next
GUISetState ()

but i want in this combo box, it has the own drive's icon like this:

Posted Image

what should i do?

Edited by LeHuynhNam

I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

Share this post


Link to post
Share on other sites



I have a combo box like this:

$HomeDrive = @HomeDrive
$1 = StringLeft($HomeDrive, 1)
$input1 = GUICtrlCreateCombo ($1, 288, 185, 52, 21,0x2042,-1)
_GUICtrlComboBox_LimitText($input1,1)

Global $odd = DriveGetDrive ("all")
For $i = 1 To $odd[0]
    $result = StringTrimRight($odd[$i], 1)  
GUICtrlSetData ($input1, $result, $odd[1])
Next
GUISetState ()

but i want in this combo box, it has the own drive's icon like this:

Posted Image

what should i do?

Look at the example in the help for _GUICtrlComboBoxEx_GetImageList

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

i've read it many times but i mean when the icon of drive change, the icon in the combo box also changed! like the combo box update the drive icon and list them with its letter, such as: [icon of C drive] [C:\]


I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

Share this post


Link to post
Share on other sites

i've read it many times but i mean when the icon of drive change, the icon in the combo box also changed! like the combo box update the drive icon and list them with its letter, such as: [icon of C drive] [C:\]

Don't you just mean FileSelectFolder("test","c:\")?


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

no! u see the title of this topic, "Problem with combo box" not fileselect folder.

I mean can i add the drive icon to combo box and update its icon. my script's here:

$HomeDrive = @HomeDrive
$1 = StringLeft($HomeDrive, 1)
$input1 = GUICtrlCreateCombo ($1, 288, 185, 52, 21,0x2042,-1)
_GUICtrlComboBox_LimitText($input1,1)

Global $odd = DriveGetDrive ("all")
For $i = 1 To $odd[0]
    $result = StringTrimRight($odd[$i], 1)  
GUICtrlSetData ($input1, $result, $odd[1])
Next
GUISetState ()

but it only show the drive without its icon, i want it can view the drive icon also!


I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

Share this post


Link to post
Share on other sites

Check the helpfile for the example of the _GUICtrlComboBoxEx_SetImageList command.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

i know what u mean but u know? when i use

_GUICtrlComboBoxEx_SetImageList

i have to use

_GUIImageList_AddIcon ($hImage, [color="#FF0000"]@SystemDir & "\shell32.dll", 146[/color])

but i don't know how to get an icon of my drive to list it to combo box? my drive's icon can change and i want when the icon changed the combo box can update its icon and view with its letter!

how can i do?


I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

Share this post


Link to post
Share on other sites

...bump... anybody can give me an example script to solve this problem


I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

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