On 26 janv. 06, at 08:25, [EMAIL PROTECTED] wrote:
I can't get a rather simple thing to work. And it seems to me that RB
is behaving in a strange way, but clearly I don't understand
something.
1. I have 25 editfields which have control numbers 1 through 25.
However, 21,22, 23,24, and 25 are read only that the user can not
alter. When I run the app and tab to #20, then it goes to 21 then 22
then 23... finally to 1. I tried putting something in lostfocus of #20
like ef(1).setfocus, but that makes it jump to ef(2) instead.
If you're using the tab key, I think the key is processed after the
LostFocus event (so you put the focus on ef(2) and then the tab key is
processed; therefore the focus goes to the next one). Just a though...
(I don't quite understand the "then 22 then 23..."; do you mean you hit
the tab key in #20 and the focus moves until #1 (via #22 and #23) in a
single press?)
2. I want to type in "a" and have it change to "A" and move to the
next field without tabbing. I do things like ef(i).text =
uppercase(ef(i).text), but it makes no difference no matter called
from lostfocus or keydown.
First, I would not suggest using ef(i).text=... because this moves the
insert point at the bottom of the EditField (in every RB versions I've
seen).
Does that works for you:
Function KeyDown(key as string)
dim a As integer
a=asc(key)
if a>96 and a<123 then 'it's a low letter
me.seltext=chr(a-32) 'Replaces the selection by the uppercase letter;
this is the same as typing it
#if targetCarbon then
Declare Function AdvanceKeyboardFocus Lib "CarbonLib" (inWindow as
WindowPtr) as Integer
#elseif TargetMacOS then
Declare Function AdvanceKeyboardFocus Lib "InterfaceLib" (inWindow
as WindowPtr) as Integer
#endif
a=AdvanceKeyboardFocus(self)
if a<>0 then msgbox "Move to next editField failed
("+str(a)+")."
return true
end if
end function
?
Here, it works fine.
I am at my wits end. I don't see any way to make these things work. It
seems there is a buffer of some sort which is not flushed very
rapidly, and it also seems that and editfield will not update itself.
I don't know.
Maybe a "composite" issue? Did you check the "Composite" property of
the window? (Composite property modifies more than the appearance of
the window).
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>