Jump to content

Recommended Posts

Posted (edited)

Here it is selected correctly:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIComboBox.au3>
GUICreate("",400,400)
GUISetState()
$inputs = GUICtrlCreateCombo("", 10, 10, 150, 30)

For $i = 1 To 3
    GUICtrlSetData($inputs,"testtest" & $i)
Next

_GUICtrlComboBox_SetCurSel($inputs, 2)
_GUICtrlComboBox_SetEditSel($inputs, 0, 4)
Sleep(3000)

Here it isn't selected:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIComboBox.au3>
GUICreate("",400,400)

$inputs = GUICtrlCreateCombo("", 10, 10, 150, 30)

For $i = 1 To 3
    GUICtrlSetData($inputs,"testtest" & $i)
Next
GUISetState()
_GUICtrlComboBox_SetCurSel($inputs, 2)
_GUICtrlComboBox_SetEditSel($inputs, 0, 4)
Sleep(3000)

using Vista OS

(the difference is the line position of GUISetState())

Edited by Markus

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Posted

I had a problem like this when I built a GUI that was to only show the menu bar. I didn't understand why I needed to move the GUISetState but by moving it, it solved my problem. I reviewed the helpfile, and I do not see anything to the effect on when GUISetState should be used after the GUICreate is used. I have to dig up my old code to show what I'm talking about.

If the GUISetState placement fixes your issue, then just run with that. IMHO.

Posted

  Markus said:

Here it is selected correctly:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIComboBox.au3>
GUICreate("",400,400)
GUISetState()
$inputs = GUICtrlCreateCombo("", 10, 10, 150, 30)

For $i = 1 To 3
    GUICtrlSetData($inputs,"testtest" & $i)
Next

_GUICtrlComboBox_SetCurSel($inputs, 2)
_GUICtrlComboBox_SetEditSel($inputs, 0, 4)
Sleep(3000)

Here it isn't selected:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIComboBox.au3>
GUICreate("",400,400)

$inputs = GUICtrlCreateCombo("", 10, 10, 150, 30)

For $i = 1 To 3
    GUICtrlSetData($inputs,"testtest" & $i)
Next
GUISetState()
_GUICtrlComboBox_SetCurSel($inputs, 2)
_GUICtrlComboBox_SetEditSel($inputs, 0, 4)
Sleep(3000)

using Vista OS

(the difference is the line position of GUISetState())

Both versions work fine for me on XP. Is it only a Vista issue?

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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
  • Recently Browsing   0 members

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