Jump to content

kstriyhon

Members
  • Posts

    5
  • Joined

  • Last visited

kstriyhon's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. hello Comunity i am new to autoit and i bump into a pitfall regarding the creation of objects in a dinamyc way but more especific creating combobox at runtime i need many comboboxes and sofar i createdthem manually like this $idCombo_1 = GUICtrlCreateCombo("", 500, 40, 130, 21)     $idCombo_2 = GUICtrlCreateCombo("", 500, 70, 130, 21)     $idCombo_3 = GUICtrlCreateCombo("", 500, 100, 130, 21)     $idCombo_4 = GUICtrlCreateCombo("", 500, 130, 130, 21)     $idCombo_5 = GUICtrlCreateCombo("", 500, 160, 130, 21)     $idCombo_6 = GUICtrlCreateCombo("", 500, 190, 130, 21)     $idCombo_7 = GUICtrlCreateCombo("", 500, 220, 130, 21)     $idCombo_8 = GUICtrlCreateCombo("", 500, 250, 130, 21)     $idCombo_9 = GUICtrlCreateCombo("", 500, 280, 130, 21)     GUICtrlSetData($idCombo_1, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_2, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_3, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_4, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_5, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_6, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_7, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_8, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_9, "Item1|Item2|Item3|Item4|Item5") now i need this example but create them at runtime as there are more than 9 combos what i need thanks in advance kind regards
  2. what do you think @JLogan3o13 is it posible to add it there?
  3. thank you in advance
  4. #include <WinAPILocale.au3> #include <GUIConstantsEx.au3> #include <IE.au3> #include <GUIConstantsEx.au3> #include <IE.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListviewConstants.au3> #include <GuiListView.au3> #include <Array.au3> #include <String.au3> ;~ global $test = "esta,es,una,cadena" $www=0 $constrim="DRIVER={SQL Server};SERVER=server;DATABASE=database;uid=user;pwd=password;" $adCN = ObjCreate ("ADODB.Connection") ; <== Create SQL connection $adCN.Open ($constrim) ; <== Connect with required credentials $registros = "SELECT top(1) COUNT(*) OVER () AS TotalRecords FROM BI_T431 INNER JOIN BI_T125 ON BI_T125.rowid_item_ext=BI_T431.f_rowid_item_ext AND BI_T125.parametro_biable = '1' where BI_T431.f_id_tipo_docto = 'pw' and f_estado_docto = 'Cumplido' group by f_id_tipo_docto,f_nrodocto,f_cargue,f_cliente_fact" $query4="SELECT f_co,f_id_tipo_docto , f_nrodocto,sum(f_valor_neto_docto) as valor,f_cargue,(select f200_razon_social from t200_mm_terceros where f200_nit = f_cliente_fact) as cliente FROM BI_T431 INNER JOIN BI_T125 ON BI_T125.rowid_item_ext=BI_T431.f_rowid_item_ext AND BI_T125.parametro_biable = '1' where BI_T431.f_id_tipo_docto = 'pw' and f_estado_docto = 'Cumplido' group by f_id_tipo_docto,f_nrodocto,f_cargue,f_cliente_fact,f_co" ;~ $result5 = $adCN.Execute($query5) $num_registros = $adCN.Execute($registros) $TotalRecords = $num_registros.Fields("TotalRecords").value $result4 = $adCN.Execute($query4) Dim $item[$TotalRecords] Dim $test = "esta,es,una,cadena" Dim $pedido[10] GUICreate("listview items", 700, 200, -1, -1, -1, $WS_EX_ACCEPTFILES) $listview = GUICtrlCreateListView("tipo documento|num documento|Cliente| Cargue|Valor|Centro de Operaciones", 10, 10, 680, 150, -1, $LVS_EX_CHECKBOXES) $button = GUICtrlCreateButton("Documentos a procesar?", 75, 170, 170, 20) While NOT $result4.EOF ; hace el bucle hasta que llegue al final de la consulta del select ;=>> aqui alguna función que haga algo con los datos la manipulas como texto, ;=>> recuperas el valor de las variables/campos user y telefono con-> $item[$www] = GUICtrlCreateListViewItem($result4.Fields("f_id_tipo_docto").value & "|" & $result4.Fields("f_nrodocto").value & "|" & $result4.Fields("cliente").value & "|" & $result4.Fields("f_cargue").value & "|" & (_WinAPI_GetNumberFormat(0, ceiling($result4.Fields("valor").value), _WinAPI_CreateNumberFormatInfo(0, 1, 3, '', ',', 1))&"|"& $result4.Fields("f_co").value & @CRLF) , $listview) $www=$www+1 $result4.MoveNext ; mueve al siguiente registro del select WEnd GUISetState() Do $msg = GUIGetMsg() Select Case $msg = $button For $x = 1 To $TotalRecords If _GUICtrlListView_GetItemChecked($listview, $x - 1) Then Local $pedido = _StringExplode(_GUICtrlListView_GetItemTextString($listview, $x - 1), "|", 0) ;~ $pedido = StringSplit(_GUICtrlListView_GetItemTextString($listview, $x - 1),"|") MsgBox(0, "listview item", $pedido[3] &"= este fue el test" , 2) ;~ MsgBox(0, "listview item", _GUICtrlListView_GetItemTextString($listview, $x - 1) & " " & @CRLF & "nombre usuario = " & $test, 2) EndIf Next Case $msg = $listview MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2) EndSelect Until $msg = $GUI_EVENT_CLOSE now i need to add a combobox as a column to this
  5. hi i am new in autoit and i am trying to create a GUI that includes a listview to display data from a a SQL select but i need to give the user the posibility to choose a value from a combobox in order to proces that data updating a table in SQL for this i would need to add a combobox with the choices in the listview value or is there other way to do it? thankyou in advanced any help would be great.
×
×
  • Create New...