Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equal
Message
From
31/03/2005 09:00:12
 
 
To
31/03/2005 08:44:23
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Re: Equal
Environment versions
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01000221
Message ID:
01000302
Views:
21
Mohammed, I'm not sure that really helps. The problem, if I understand you correctly, is that when you hit the '1' on the keyboard while the listbox has focus and a hilight, the hilight jumps to '10' in the list. This is it's natural behaviour, and I'm pretty sure the only way to change it is to put a lot of code into the 'keypress event' to make it deviate from that natural behavour.

If your hilight is on '5', for instance, and you hit '1' on the keyboard, it will not jump backward to the '1', it will jump forward to the '10'. Using the mouse instead of the keyboard, of course, makes the problem go away.

The InteractiveChange procedure will only occur after your hilight has moved, and if it moves to the wrong item, you can pretty much put whatever code you want into the InteractiveChange, and it still won't do what you want it to.

>hi,
>
>this is the code at procedure interactive change
>
>ThisForm.Text1.Format='K'
>thisform.text1.Value=IIF(VARTYPE(this.value)="C",val(this.value),This.Value)
>
>SELECT 5
>*ZAP
>DELETE all
>IF USED('mstr')
>  SELECT mstr
>ELSE
>  SELECT 0
>  USE mstr AGAIN
>ENDIF
>inyearofbill=thisform.text22.value
>inyearofbill=2000+VAL(RIGHT(ALLTRIM(STR(thisform.text22.Value)),2))
>LOCATE FOR billno=thisform.text1.Value AND YEAR(mstr.datein)= inyearofbill
>
>IF ! FOUND()
>=MESSAGEBOX("agagaegaerr")
>else
>SET FILTER to billno=thisform.text1.value and YEAR(mstr.datein)= inyearofbill
> THISFORM.TEXT1.VALUE=BILLNO
> THISFORM.TEXT2.VALUE=DATEIN
> THISFORM.TEXT3.VALUE=NAM1
> THISFORM.TEXT4.VALUE=INNAME
> THISFORM.TEXT5.VALUE=TYPE1
> THISFORM.TEXT6.VALUE=INNOUMBER
> THISFORM.TEXT7.VALUE=PRICE
> THISFORM.TEXT8.VALUE=TOTAL
> THISFORM.TEXT10.VALUE=SALE
>sum total to thisform.text13.value
>GO BOTTOM
>  thisform.text27.value=DIS
>  SUM NET TO thisform.text28.value
>  ******************************************
>select 1
>
>  USE MSTR EXCL
>
> LOCATE FOR BILLNO=THISFORM.TEXT1.VALUE and YEAR(mstr.datein)= inyearofbill
>  if found()
>   SET FILTER TO BILLNO=THISFORM.TEXT1.VALUE and YEAR(mstr.datein)= inyearofbill
>
>
>  SELECT 5
>  USE TEMP EXCL
>  Append From Dbf('MSTR')  FOR BILLNO=THISFORM.TEXT1.VALUE and YEAR(mstr.datein)= inyearofbill
>   GO TOP
>  With thisform.grid1
>   .recordsource = ''
>   Select temp
>    .recordsource = 'temp'
>    thisform.list1.SetFocus
>
>   thisform.refresh
>  endwith
>else
>=messagebox("ÇáÝÇÊæÑÉ ÛíÑ ãæÌæÏÉ")
>thisform.text3.value=space(10)
>thisform.text4.value=space(10)
>thisform.text5.value=space(10)
>thisform.text6.value=0
>thisform.text7.value=0
>thisform.text8.value=0
>thisform.text10.value=0
>ENDIF
>ENDIF
>SELECT 1
>
>I assume you're entering your keystrokes in the listbox? If so, remember that the incremental search happens starting at the location where your selection is. So, when you start up, your selection is '1'. If you then type a '1', your selection will jump down to the next '1', which is the first digit in the '10'. If you then type a '2', it won't jump backwards up the the '2', it will jump forward to the '20'.
>>
>>I don't know a good way to do what you're trying to do without a lot of program code to trap keystrokes in the listbox.
>>
>>Alan
>>
>>>hi,
>>>still if i press at mylist 1 i get the same 10 another press i get 11...
>>>
>>>
>>>>Mohammed,
>>>>
>>>>IN Text1.GotFocus put
>>>>
TEXTBOX::GotFocus
>>>>
>>>>and set the property SelectOnEntry = .t.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform