When you are in a textbox and you want to select something in a listbox you
have to click two times.

the first time to select the listbox and the second time to select something
in the listbox.

Does someone know how to do tis with one click.

thanks Stefan

Re: Problem with listbox by Stefan

Stefan
Sat Mar 06 06:27:49 CST 2004

"Stefan Bosman" <compu-soft@skynet.be> schrieb im Newsbeitrag
news:%23SbWXi2AEHA.3836@TK2MSFTNGP10.phx.gbl...
> When you are in a textbox and you want to select something in a listbox
you
> have to click two times.
>
> the first time to select the listbox and the second time to select
something
> in the listbox.
>
> Does someone know how to do tis with one click.

Hi Stefan,

I think "usually" listboxes do not behave the way you described,
IOW it may depend on the way the mouse click is evaluated ...
I pasted an old runnable example.prg below which was not directly
made to address your issue but works with a single click. If it does
not help, can you further details of what you mean?


-Stefan


* lisbox_singleclick.prg
LOCAL oForm
oForm = CREATEOBJECT('TestForm')
oForm.Show(1)
RETURN

DEFINE CLASS TestForm as Form
ScrollBars = 1
ADD OBJECT txtDummy as Textbox WITH ;
Left = 10, Top = 0, Value = 'nothing here'
PROCEDURE Init
This.AddList()
ENDPROC
PROCEDURE AddList
LOCAL cObject, oObject
WITH Thisform
cObject = 'list' + TRANSFORM(.ControlCount)
.AddObject(m.cObject,'TestList')
oObject = .Controls(.ControlCount)
oObject.Left = 100 * (.ControlCount-3)
oObject.Top = 30
oObject.Visible = .T.
ENDWITH
ENDPROC
ADD OBJECT cmdAddlist as Commandbutton WITH ;
Left = 10, Top = 210, Height = 24, ;
Caption = "new listbox"
PROCEDURE cmdAddList.Click
Thisform.AddList()
ENDPROC

ENDDEFINE

DEFINE CLASS TestList as ListBox
PROCEDURE Init
This.AddItem('One')
This.AddItem('Two')
ENDPROC
PROCEDURE Click
MESSAGEBOX(This.Value)
ENDPROC

ENDDEFINE


Re: Problem with listbox by Eric

Eric
Sat Mar 06 06:57:30 CST 2004

Hello, Stefan!

This is not normal behavior. Do you have custom code in the
listbox.gotfocus(), listbox.when() or any other method/event that might
interfere?
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8