Jump to content

Change the position of a combobox created with _GUICtrlComboBox_Create


Omega
 Share

Recommended Posts

I would like to know if there is a way to change the position of a combobox created with _GUICtrlComboBox_Create, I did this in my script by saving values of comboboxes, deleting and creating new ones with the saved values, but that is too much unnecessary code, when I just have to move them 21 pixels up.

Any help is much appreciated!

#include <WindowsConstants.au3>
#include <TreeViewConstants.au3>
#include <ToolbarConstants.au3>
#include <ListViewConstants.au3>
#include <EditConstants.au3>
#include <Constants.au3>
#include <ComboConstants.au3>
#include <ButtonConstants.au3>
#include <GuiConstants.au3>
#Include <GuiImageList.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiTreeView.au3>
#include <GuiToolbar.au3>
#include <GuiComboBox.au3>
#Include <GuiComboBoxEx.au3>

Local $Limit = 99
Local $TreeView_1_Item_1[$Limit + 1]
Local $TreeView_2_Item_2[$Limit + 1]
Local $ComboBox_1[$Limit + 1][5]
Local $Item[$Limit + 1]
Local $Number_Width = 40
Local $Set_Width = 160
Local $Rarity_Width = 90
Local $Version_Width = 90
Local $Owned_Width = 60
Local $ForTrade_Width = 60
Local $SortBy_Width = 105
Local $PosX_[5]

$Main = GuiCreate("SmartBot v1", 1024, 500, 125, 250, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
GUISetFont(8.5, 400, 0, "Comic Sans MS")
GUISetIcon("shell32.dll", 14)
$MainTab = GUICtrlCreateTab(0, 30, 1024, 480)
GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKTOP)
#region Tab_1
    $Tab_Item_1 = GUICtrlCreateTabItem("Buying Mode")
   
    #region TreeView
        $Label_1 = GUICtrlCreateLabel("SETS", 5, 60, 56, 12)
        GUICtrlSetResizing( -1, $GUI_DOCKALL )
        $TreeView_1 = GUICtrlCreateTreeView(5, 75, 185, 380, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE )
        GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH)
       
        #region Sets
            $b = 1
            While $b < 15
                $TreeView_1_Item_1[$b - 1] = GUICtrlCreateTreeViewItem($b, $TreeView_1)
                _GUICtrlTreeView_SetIcon($TreeView_1, $TreeView_1_Item_1[$b - 1], "shell32.dll", $B)
                $b = $b + 1
            WEnd
        #endregion
       
    #endregion treeview
   
    #region Button_1 and Button2
        $Button_Add_1 = GUICtrlCreateButton("Add >>", 196, 250, 75, 25)
        GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKSIZE)
        $Button_Delete_1 = GUICtrlCreateButton("<< Delete", 196, 280, 75, 25)
        GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKSIZE)
    #endregion
   
    #region ListView
        $Pre_ListView_1 = GUICtrlCreateListView( "N°", 275, 75, 610, 380, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS))
        GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKTOP)
        $ListView_1 = GUICtrlGetHandle($Pre_ListView_1)
        GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKTOP)
        _GUICtrlListView_SetExtendedListViewStyle($ListView_1, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP))
        _GUICtrlListView_SetColumnWidth($ListView_1, 0, $Number_Width)
        $hImage_1 = _GUIImageList_Create(20, 20, 5, 3)
       
        $b = 1
        While $b < 15
            _GUIImageList_AddIcon($hImage_1, "shell32.dll", $B)
            $b = $b + 1
        WEnd
       
        _GUICtrlListView_SetImageList($ListView_1, $hImage_1, 1)
        $ListView_Col_Set_1 = _GUICtrlListView_AddColumn($ListView_1, "Selected Sets", $Set_Width)
        $ListView_Col_Rarity_1 = _GUICtrlListView_AddColumn($ListView_1, "Rarity", $Rarity_Width)
        $ListView_Col_Version_1 = _GUICtrlListView_AddColumn($ListView_1, "Version", $Version_Width)
        $ListView_Col_Owned_1 = _GUICtrlListView_AddColumn($ListView_1, "Owned", $Owned_Width)
        $ListView_Col_ForTrade_1 = _GUICtrlListView_AddColumn($ListView_1, "For Trade", $ForTrade_Width)
        $ListView_Col_SortBy_1 = _GUICtrlListView_AddColumn($ListView_1, "Sort By", $SortBy_Width)
    #endregion ListView
   
    #region
        GUICtrlCreateLabel("HOLA", 225, 75, 56, 12, -1, $WS_EX_MDICHILD)
    #endregion
   
#endregion

#region ToolBar
    $hToolbar = _GUICtrlToolbar_Create($Main,BitOR($TBSTYLE_TOOLTIPS,$TBSTYLE_FLAT))
    _GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_SMALL_COLOR)
    _GUICtrlToolbar_AddButton($hToolbar, 1000, $STD_FILENEW)
    _GUICtrlToolbar_AddButton($hToolbar, 1001, $STD_FILEOPEN)
    _GUICtrlToolbar_AddButton($hToolbar, 1002, $STD_FILESAVE)
    _GUICtrlToolbar_AddButtonSep($hToolbar)
    _GUICtrlToolbar_AddButton($hToolbar, 1003, $STD_PROPERTIES)
#endregion

#region MenuBar
    $MenuItem_1 = GUICtrlCreateMenu("&File")
    $MenuItem_1_File_1 = GUICtrlCreateMenuItem("Open", $MenuItem_1)
    $MenuItem_2 = GUICtrlCreateMenu("&Option")
#endregion

GUICtrlSetState($Tab_Item_1,$GUI_SHOW)

GUISetState(@SW_SHOW, $Main)

While 1
    $msg = GUIGetMsg(1)
    Select
        Case $msg[0] = $GUI_EVENT_CLOSE
           
            If $msg[1] = $Main Then
                ExitLoop
            EndIf
           
        Case $msg[0] = $Button_Add_1
           
            $SearchItem_1 = 0
            While 1
                If _GUICtrlTreeView_GetSelected($TreeView_1, $TreeView_1_Item_1[$SearchItem_1]) = True Or $SearchItem_1 = $Limit Then
                    ExitLoop
                EndIf
                $SearchItem_1 = $SearchItem_1 + 1
            WEnd
            Dim $Info[5]
            For $i = 0 to 4
                $Info[$i] = 0
            Next
            If $SearchItem_1 = $Limit Then
                MsgBox(0, "Message", "You Can't Add More Sets")
            Else
                _GUICtrlListView_AddItem($ListView_1, _GUICtrlListView_GetItemCount($ListView_1) + 1, $SearchItem_1)
                _GUICtrlListView_AddSubItem($ListView_1, _GUICtrlListView_GetItemCount($ListView_1) - 1, _GUICtrlTreeView_GetText($TreeView_1, $TreeView_1_Item_1[$SearchItem_1]), 1)
                Create_ComboBoxes((-2 + (_GUICtrlListView_GetItemCount($ListView_1) * 21)), _GUICtrlListView_GetItemCount($ListView_1), $Info)
                GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_DISABLED), -1, $Main)
                MsgBox(4144, "Message", "Set Added Successfully")
                GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX), -1, $Main)
            EndIf
           
            GUICtrlSetPos($ComboBox_1[3][0], 230, 150)
           
        Case $msg[0] = $Button_Delete_1
           
            $SearchItem_1 = 0
            While 1
                If _GUICtrlListView_GetItemSelected($ListView_1, $SearchItem_1) = True or $SearchItem_1 = $Limit Then
                    ExitLoop
                EndIf
                $SearchItem_1 = $SearchItem_1 + 1
            WEnd
            If $SearchItem_1 = $Limit Then
                MsgBox(0, "Message", "You Haven't Choosed a Set to Delete")
            Else
                For $i = 0 To 4
                    _GUICtrlComboBox_Destroy($ComboBox_1[$SearchItem_1 + 1][$i])
                Next
                _GUICtrlListView_DeleteItem($ListView_1, $SearchItem_1)
                For $i = $SearchItem_1 To _GUICtrlListView_GetItemCount($ListView_1) - 1
                    _GUICtrlListView_SetItem($ListView_1, $i + 1, $i)
                    For $j = 0 To 4
                        $Info[$j] = _GUICtrlComboBox_GetCurSel($ComboBox_1[$i + 2][$j])
                        _GUICtrlComboBox_Destroy($ComboBox_1[$i + 2][$j])
                    Next
                    Create_ComboBoxes((-2 + (($i + 1) * 21)), $i + 1, $Info)
                Next
                GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_DISABLED), -1, $Main)
                MsgBox(4144, "Message", "Set Deleted")
                GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX), -1, $Main)
            EndIf
           
        Case $msg[0] = $ListView_1
            MsgBox(4144, "Message", "Lista")
           
    EndSelect

WEnd

Func Create_ComboBoxes_2($PosX, $PosY, $Section, $Index_1, $Index_2, $Width, $Information)
   
    $a = 1
    $Data = ""
    $ComboText = ""
    For $i = 1 to 5
        $Data = $i
        $ComboText = $ComboText & $Data & "|"
        $a = $a + 1
    Next
    $ComboBox_1[$Index_1][$Index_2] = _GUICtrlComboBox_Create($ListView_1, StringTrimRight($ComboText, 1), $PosX, $PosY, $Width, 10, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL, $WS_VSCROLL))
    If $Information = 0 Then
        _GUICtrlComboBox_SetCurSel($ComboBox_1[$Index_1][$Index_2], 0)
    Else
        _GUICtrlComboBox_SetCurSel($ComboBox_1[$Index_1][$Index_2], $Information)
    EndIf
    GUICtrlDelete($ComboBox_1[$Index_1][$Index_2])
   
EndFunc

Func Create_ComboBoxes($PosY, $Index_1, $Info)
   
    $PosX = $Number_Width + $Set_Width
    $PosX_[0] = $PosX
    Create_ComboBoxes_2($PosX, $PosY, "Rarity", $Index_1, 0, $Rarity_Width, $Info[0])
   
    $PosX = $PosX + $Rarity_Width
    $PosX_[1] = $PosX
    Create_ComboBoxes_2($PosX, $PosY, "Version", $Index_1, 1, $Version_Width, $Info[1])
   
    $PosX = $PosX + $Version_Width
    $PosX_[2] = $PosX
    Create_ComboBoxes_2($PosX, $PosY, "Owned", $Index_1, 2, $Owned_Width, $Info[2])
   
    $PosX = $PosX + $Owned_Width
    $PosX_[3] = $PosX
    Create_ComboBoxes_2($PosX, $PosY, "ForTrade", $Index_1, 3, $ForTrade_Width, $Info[3])
   
    $PosX = $PosX + $ForTrade_Width
    $PosX_[4] = $PosX
    Create_ComboBoxes_2($PosX, $PosY, "SortBy", $Index_1, 4, $SortBy_Width, $Info[4])
   
EndFunc
Link to comment
Share on other sites

I would like to know if there is a way to change the position of a combobox created with _GUICtrlComboBox_Create, I did this in my script by saving values of comboboxes, deleting and creating new ones with the saved values, but that is too much unnecessary code, when I just have to move them 21 pixels up.

Any help is much appreciated!

#include <WindowsConstants.au3>
#include <TreeViewConstants.au3>
#include <ToolbarConstants.au3>
#include <ListViewConstants.au3>
#include <EditConstants.au3>
#include <Constants.au3>
#include <ComboConstants.au3>
#include <ButtonConstants.au3>
#include <GuiConstants.au3>
#Include <GuiImageList.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiTreeView.au3>
#include <GuiToolbar.au3>
#include <GuiComboBox.au3>
#Include <GuiComboBoxEx.au3>

Local $Limit = 99
Local $TreeView_1_Item_1[$Limit + 1]
Local $TreeView_2_Item_2[$Limit + 1]
Local $ComboBox_1[$Limit + 1][5]
Local $Item[$Limit + 1]
Local $Number_Width = 40
Local $Set_Width = 160
Local $Rarity_Width = 90
Local $Version_Width = 90
Local $Owned_Width = 60
Local $ForTrade_Width = 60
Local $SortBy_Width = 105
Local $PosX_[5]

$Main = GuiCreate("SmartBot v1", 1024, 500, 125, 250, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
GUISetFont(8.5, 400, 0, "Comic Sans MS")
GUISetIcon("shell32.dll", 14)
$MainTab = GUICtrlCreateTab(0, 30, 1024, 480)
GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKTOP)
#region Tab_1
    $Tab_Item_1 = GUICtrlCreateTabItem("Buying Mode")
   
    #region TreeView
        $Label_1 = GUICtrlCreateLabel("SETS", 5, 60, 56, 12)
        GUICtrlSetResizing( -1, $GUI_DOCKALL )
        $TreeView_1 = GUICtrlCreateTreeView(5, 75, 185, 380, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE )
        GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH)
       
        #region Sets
            $b = 1
            While $b < 15
                $TreeView_1_Item_1[$b - 1] = GUICtrlCreateTreeViewItem($b, $TreeView_1)
                _GUICtrlTreeView_SetIcon($TreeView_1, $TreeView_1_Item_1[$b - 1], "shell32.dll", $B)
                $b = $b + 1
            WEnd
        #endregion
       
    #endregion treeview
   
    #region Button_1 and Button2
        $Button_Add_1 = GUICtrlCreateButton("Add >>", 196, 250, 75, 25)
        GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKSIZE)
        $Button_Delete_1 = GUICtrlCreateButton("<< Delete", 196, 280, 75, 25)
        GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKSIZE)
    #endregion
   
    #region ListView
        $Pre_ListView_1 = GUICtrlCreateListView( "N°", 275, 75, 610, 380, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS))
        GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKTOP)
        $ListView_1 = GUICtrlGetHandle($Pre_ListView_1)
        GUICtrlSetResizing( -1, $GUI_DOCKLEFT + $GUI_DOCKTOP)
        _GUICtrlListView_SetExtendedListViewStyle($ListView_1, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP))
        _GUICtrlListView_SetColumnWidth($ListView_1, 0, $Number_Width)
        $hImage_1 = _GUIImageList_Create(20, 20, 5, 3)
       
        $b = 1
        While $b < 15
            _GUIImageList_AddIcon($hImage_1, "shell32.dll", $B)
            $b = $b + 1
        WEnd
       
        _GUICtrlListView_SetImageList($ListView_1, $hImage_1, 1)
        $ListView_Col_Set_1 = _GUICtrlListView_AddColumn($ListView_1, "Selected Sets", $Set_Width)
        $ListView_Col_Rarity_1 = _GUICtrlListView_AddColumn($ListView_1, "Rarity", $Rarity_Width)
        $ListView_Col_Version_1 = _GUICtrlListView_AddColumn($ListView_1, "Version", $Version_Width)
        $ListView_Col_Owned_1 = _GUICtrlListView_AddColumn($ListView_1, "Owned", $Owned_Width)
        $ListView_Col_ForTrade_1 = _GUICtrlListView_AddColumn($ListView_1, "For Trade", $ForTrade_Width)
        $ListView_Col_SortBy_1 = _GUICtrlListView_AddColumn($ListView_1, "Sort By", $SortBy_Width)
    #endregion ListView
   
    #region
        GUICtrlCreateLabel("HOLA", 225, 75, 56, 12, -1, $WS_EX_MDICHILD)
    #endregion
   
#endregion

#region ToolBar
    $hToolbar = _GUICtrlToolbar_Create($Main,BitOR($TBSTYLE_TOOLTIPS,$TBSTYLE_FLAT))
    _GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_SMALL_COLOR)
    _GUICtrlToolbar_AddButton($hToolbar, 1000, $STD_FILENEW)
    _GUICtrlToolbar_AddButton($hToolbar, 1001, $STD_FILEOPEN)
    _GUICtrlToolbar_AddButton($hToolbar, 1002, $STD_FILESAVE)
    _GUICtrlToolbar_AddButtonSep($hToolbar)
    _GUICtrlToolbar_AddButton($hToolbar, 1003, $STD_PROPERTIES)
#endregion

#region MenuBar
    $MenuItem_1 = GUICtrlCreateMenu("&File")
    $MenuItem_1_File_1 = GUICtrlCreateMenuItem("Open", $MenuItem_1)
    $MenuItem_2 = GUICtrlCreateMenu("&Option")
#endregion

GUICtrlSetState($Tab_Item_1,$GUI_SHOW)

GUISetState(@SW_SHOW, $Main)

While 1
    $msg = GUIGetMsg(1)
    Select
        Case $msg[0] = $GUI_EVENT_CLOSE
           
            If $msg[1] = $Main Then
                ExitLoop
            EndIf
           
        Case $msg[0] = $Button_Add_1
           
            $SearchItem_1 = 0
            While 1
                If _GUICtrlTreeView_GetSelected($TreeView_1, $TreeView_1_Item_1[$SearchItem_1]) = True Or $SearchItem_1 = $Limit Then
                    ExitLoop
                EndIf
                $SearchItem_1 = $SearchItem_1 + 1
            WEnd
            Dim $Info[5]
            For $i = 0 to 4
                $Info[$i] = 0
            Next
            If $SearchItem_1 = $Limit Then
                MsgBox(0, "Message", "You Can't Add More Sets")
            Else
                _GUICtrlListView_AddItem($ListView_1, _GUICtrlListView_GetItemCount($ListView_1) + 1, $SearchItem_1)
                _GUICtrlListView_AddSubItem($ListView_1, _GUICtrlListView_GetItemCount($ListView_1) - 1, _GUICtrlTreeView_GetText($TreeView_1, $TreeView_1_Item_1[$SearchItem_1]), 1)
                Create_ComboBoxes((-2 + (_GUICtrlListView_GetItemCount($ListView_1) * 21)), _GUICtrlListView_GetItemCount($ListView_1), $Info)
                GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_DISABLED), -1, $Main)
                MsgBox(4144, "Message", "Set Added Successfully")
                GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX), -1, $Main)
            EndIf
           
            GUICtrlSetPos($ComboBox_1[3][0], 230, 150)
           
        Case $msg[0] = $Button_Delete_1
           
            $SearchItem_1 = 0
            While 1
                If _GUICtrlListView_GetItemSelected($ListView_1, $SearchItem_1) = True or $SearchItem_1 = $Limit Then
                    ExitLoop
                EndIf
                $SearchItem_1 = $SearchItem_1 + 1
            WEnd
            If $SearchItem_1 = $Limit Then
                MsgBox(0, "Message", "You Haven't Choosed a Set to Delete")
            Else
                For $i = 0 To 4
                    _GUICtrlComboBox_Destroy($ComboBox_1[$SearchItem_1 + 1][$i])
                Next
                _GUICtrlListView_DeleteItem($ListView_1, $SearchItem_1)
                For $i = $SearchItem_1 To _GUICtrlListView_GetItemCount($ListView_1) - 1
                    _GUICtrlListView_SetItem($ListView_1, $i + 1, $i)
                    For $j = 0 To 4
                        $Info[$j] = _GUICtrlComboBox_GetCurSel($ComboBox_1[$i + 2][$j])
                        _GUICtrlComboBox_Destroy($ComboBox_1[$i + 2][$j])
                    Next
                    Create_ComboBoxes((-2 + (($i + 1) * 21)), $i + 1, $Info)
                Next
                GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_DISABLED), -1, $Main)
                MsgBox(4144, "Message", "Set Deleted")
                GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_SIZEBOX), -1, $Main)
            EndIf
           
        Case $msg[0] = $ListView_1
            MsgBox(4144, "Message", "Lista")
           
    EndSelect

WEnd

Func Create_ComboBoxes_2($PosX, $PosY, $Section, $Index_1, $Index_2, $Width, $Information)
   
    $a = 1
    $Data = ""
    $ComboText = ""
    For $i = 1 to 5
        $Data = $i
        $ComboText = $ComboText & $Data & "|"
        $a = $a + 1
    Next
    $ComboBox_1[$Index_1][$Index_2] = _GUICtrlComboBox_Create($ListView_1, StringTrimRight($ComboText, 1), $PosX, $PosY, $Width, 10, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL, $WS_VSCROLL))
    If $Information = 0 Then
        _GUICtrlComboBox_SetCurSel($ComboBox_1[$Index_1][$Index_2], 0)
    Else
        _GUICtrlComboBox_SetCurSel($ComboBox_1[$Index_1][$Index_2], $Information)
    EndIf
    GUICtrlDelete($ComboBox_1[$Index_1][$Index_2])
   
EndFunc

Func Create_ComboBoxes($PosY, $Index_1, $Info)
   
    $PosX = $Number_Width + $Set_Width
    $PosX_[0] = $PosX
    Create_ComboBoxes_2($PosX, $PosY, "Rarity", $Index_1, 0, $Rarity_Width, $Info[0])
   
    $PosX = $PosX + $Rarity_Width
    $PosX_[1] = $PosX
    Create_ComboBoxes_2($PosX, $PosY, "Version", $Index_1, 1, $Version_Width, $Info[1])
   
    $PosX = $PosX + $Version_Width
    $PosX_[2] = $PosX
    Create_ComboBoxes_2($PosX, $PosY, "Owned", $Index_1, 2, $Owned_Width, $Info[2])
   
    $PosX = $PosX + $Owned_Width
    $PosX_[3] = $PosX
    Create_ComboBoxes_2($PosX, $PosY, "ForTrade", $Index_1, 3, $ForTrade_Width, $Info[3])
   
    $PosX = $PosX + $ForTrade_Width
    $PosX_[4] = $PosX
    Create_ComboBoxes_2($PosX, $PosY, "SortBy", $Index_1, 4, $SortBy_Width, $Info[4])
   
EndFunc
If you keep track of the comboxes as you create them you can move them with ControlGetPos and ControlMove

$cp = ControlGetPos($main,"","ComboBox1");get pos of 1st combo
$lp = ControlGetPos($main,"","SysListView321");get the pos of the listview
ControlMove($main,"","ComboBox1",$cp[0] - $lp[0],$cp[1] - $lp[1] +22);move the combo down 22 pixels

If you know that the combobox was the $comboNum made where $comboNum is 1 for the first 2 for the second etc, then instead of

"ComboBox1"

you can have

"ComboBox" & $comboNum

(Hoping I understood what you were after.)

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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...