Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetFocus and Property Modify

0 views
Skip to first unread message

Pere Pie

unread,
Dec 12, 2001, 1:10:01 PM12/12/01
to

Using PB8.0.1 Builb 8004

I code the next script in getfocus event of a dropdownlistbox control

ddlb_1.showlist = true

When control got focus program crashes? WHY?

Bug

unread,
Dec 12, 2001, 1:44:07 PM12/12/01
to
Is it possible that when the list display, it briefly gets focus, then moves
focus back to the window? I would suspect an infinite loop in your activate
event... all too easy to happen. Try to avoid the activate and getfocus
events as much as possible. To work around, put your code in a function and
POST that function from your getfocus event.


"Pere Pie" <per...@retemail.es> wrote in message
news:EzRiKnz...@forums.sybase.com...

Philip_Salgannik

unread,
Dec 12, 2001, 4:33:57 PM12/12/01
to
Is AllowEdit set to TRUE?

Pere Pie

unread,
Dec 13, 2001, 2:49:17 AM12/13/01
to
Yes

<Philip_Salgannik> escribió en el mensaje
news:39383AE3B76DDA610076772B85256B20.00679CA185256B20@webforums...

Philip_Salgannik

unread,
Dec 13, 2001, 11:47:24 AM12/13/01
to
If you are totally hung up on this behaviour, create a custom control that
will do it for you. Make a user object - descendant of a datawindow
control, create a dataobject which will have one string column in it, then
set the edit style of this column to be dddw (you can assign this same
dataobject as the dddw to it), mark it as AlwaysShowList, assign this
dataobject to the userobject, place it where you neede it and voila, it
will do what you want.

Terry Voth

unread,
Dec 13, 2001, 9:03:23 AM12/13/01
to
I think Bug's on the right path. Pushing a major change to a control
after it has gotten focus usually causes problems. I'd suspect
changing ShowList means the control has to be recreated. If you've got
that coded in the GetFocus event, that will cause an infinite loop. At
least, that's my theory. My experience says to avoid coding GetFocus,
and not to code changes to the control there.

Good luck,

Terry [TeamSybase] and Sequel the techno-kitten

On Wed, 12 Dec 2001 12:44:07 -0600, "Bug" <fent...@hotmail.com>
wrote:

Sequel's Sandbox: http://www.techno-kitten.com
Home of PBL Peeper, a PowerBuilder Developer's Toolkit.
Version 2.1.01 now available at the Sandbox
^ ^
o o
=*=

Simon Caldwell [TeamSybase]

unread,
Dec 14, 2001, 5:43:04 AM12/14/01
to
If this is what's happening then a workround would be to declare an instance
boolean and change your getfocus code to something like:

if not ib_started then
ib_started = true
ddlb_1.showlist = true
ib_started=false
end if

--

Simon Caldwell
Get Real Systems Ltd
Holtby Manor, Stamford Bridge Road, York, YO19 5LL
Tel +44 (0)1904 481999 Fax +44 (0)1904 481666
Visit us at www.getrealsystems.com
Procurement Control Specialists
Controlling corporate spend and streamlining procurement processes


"Terry Voth" <seq...@techno-kitten.com> wrote in message
news:83dh1ugqn2tlt6s97...@4ax.com...

0 new messages