realbasic-nug.fr
[Top] [All Lists]

Re: Petites questions

To: REALbasic NUG French <realbasic-nug dot fr at lists dot realsoftware dot com>
Subject: Re: Petites questions
From: Thierry NAUZE <ohmi at orange dot fr>
Date: Thu, 29 May 2008 18:41:03 +0400
Authentication-results: mx.google.com; spf=pass (google.com: domain of realbasic-nug dot fr-bounces at lists dot realsoftware dot com designates 66.116.103.65 as permitted sender) smtp dot mail=realbasic-nug dot fr-bounces at lists dot realsoftware dot com
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug dot fr at lists dot realsoftware dot com
References: <7A4FF7FD-E112-4EE6-BBDF-883086168E48 at mac dot com> <83568154-8116-4F9F-A33B-9E32C47B2E8B at adx-online dot com> <6B175D47-C8FF-4BA9-BBB1-29BCA2C65791 at mac dot com> <41B48185-6EEE-4A85-80FE-9E01AFB56A56 at mac dot com> <788CF6B6-06E1-4FBC-9B35-D66B1B2E68F4 at mac dot com> <890B8110-46E3-4AAE-9A1A-99477F8776AF at mac dot com> <1FA87133-DBAA-41FD-A8AA-7854909AA0D4 at mac dot com> <14F7EF01-43D1-40FA-A335-F0C93A40A29B at marine-label dot com> <C3738EC1-063D-444B-BDE1-7E0A6C6ECB54 at mac dot com> <568CF0B7-0C9A-482E-84FF-7EBA43FBC09C at mac dot com> <D00D23B6-E836-4A81-AF6F-CB4DC38FB181 at mac dot com> <8E8E3B99-B5D2-4E11-B664-EBA8F652B5B7 at mac dot com> <F53AA3D3-0B1F-4EE7-B3BC-5391C58EB9B1 at cretaux dot fr> <1AF925CE-4930-4F9E-B494-17723C51DEFE at mac dot com> <86013A84-7959-4DE9-BF7A-EE13232666D7 at cretaux dot fr> <48E75137-B461-4395-A4D7-695268B4B05A at mac dot com> <B5CCABA6-EE28-4CF3-851F-0363D4A6AF7B at mac dot com> <670000DB-E781-4F48-B91E-03A7557314AF at cretaux dot fr> <742EDC46-6823-47FD-A3A3-2C01A9841795 at mac dot com>

Le 29 mai 08 à 18:15, Sébastien Debiève a écrit :

Cher moi, cela fait toujours 2 sélections quand je navigue dans ma listbox à l'aide des touches du clavier. :-(

Sébastien


Le 29-mai-08 à 16:06, Antoine Crêtaux a écrit :

Il vous suffit de vous placez dans l'event keydown de la listr et de faire un simple

me.ListIndex=-1



Perso, dans l'évènement KeyDown, j'utilise ce code (à adapter, bien évidemment) :


  dim id as string

  if me.ListIndex >=0 then

    if  asc(key)=31 then ' Flèche bas
      if me.listindex<me.listCount-1 then

        ' Lecture d'une valeur dans la nouvelle ligne
' A noter l'utilisation de me.listindex+1 et non de me.listindex
        id=me.cell(me.listindex+1,1)

        ' ACTION dans le cas présent
        if val(id)>0 and pIndex<>id then
          activeLePersonnage(id)
' Après l'action, je repasse le focus à la liste, pour réactiver les flèches.
          me.SetFocus
        end

      else
        beep
      end

    ' Dans l'autre sens.
    elseif asc(key)=30 then ' Flèche haut
      if me.ListIndex >0 then

        id=me.cell(me.listindex-1,1)
        if val(id)>0 and pIndex<>id then
          activeLePersonnage(id)
          me.SetFocus
        end

      else
        beep
      end

    end

  end



Cordialement,


--
Thierry NAUZE
Saint-Denis de la Réunion





<Prev in Thread] Current Thread [Next in Thread>