Shortcut keys to textbox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maurice Mertens

    Shortcut keys to textbox

    Hi,

    I'm trying to set shortcut keys for textboxes. But what is the best way to
    do this in VB.NET. In Access it was very simple, just put an "&" sign in
    the label that belongs to the textbox. But in VB.NET it looks like you have
    to program code for the shortcut keys.

    Like putting this code in the Form_KeyUp:

    If e.Alt And e.KeyCode = Keys.L Then Me.ActiveContro l = Me.TextBox1



    Is this correct?


    --
    Met vriendelijke groet / With regards / Saludos,
    Moviat Automatisering


    Maurice Mertens
    mauricem@moviat _KillSpamWordFo rEMail.nl

    tel: +31 162 470 534
    fax: +31 162 470 502
  • Shiva

    #2
    Re: Shortcut keys to textbox

    Set the tab index of the text box to be next to that of its associated label
    control in sequence (eg: Label TabIndex is 6 and its TextBox TabIndex is 7).
    And have & in the Label control for the short-cut key and that should work.

    HTH.

    "Maurice Mertens" <mauricem@movia t_KillSpamWordF orEMail.nl> wrote in message
    news:Xns956E65B 4C6C70mauricemm oviat@207.46.24 8.16...
    Hi,

    I'm trying to set shortcut keys for textboxes. But what is the best way to
    do this in VB.NET. In Access it was very simple, just put an "&" sign in
    the label that belongs to the textbox. But in VB.NET it looks like you have
    to program code for the shortcut keys.

    Like putting this code in the Form_KeyUp:

    If e.Alt And e.KeyCode = Keys.L Then Me.ActiveContro l = Me.TextBox1



    Is this correct?


    --
    Met vriendelijke groet / With regards / Saludos,
    Moviat Automatisering


    Maurice Mertens
    mauricem@moviat _KillSpamWordFo rEMail.nl

    tel: +31 162 470 534
    fax: +31 162 470 502


    Comment

    • Cor Ligthert

      #3
      Re: Shortcut keys to textbox

      Maurice,

      I do not see what you exactly want to archieve. Maybe others see it but not
      me. Refering to MS Access in the dotNet newsgroups is not the best way of
      explaining when you want to have the best answers, a lot have expirience
      with that, but the most who are very deep in dotNet probably a long time not
      anymore.

      However because you are using VBNet you have probably a better change by
      posting your question (as well) to the newsgroup
      microsoft.publi c.dotnet.langua ges.vb

      (You can send your further explanations here or/and to the VBNet newsgroup
      just as you wish, you are free to do what you want)

      Cor

      "Maurice Mertens"[color=blue]
      > Hi,
      >
      > I'm trying to set shortcut keys for textboxes. But what is the best way to
      > do this in VB.NET. In Access it was very simple, just put an "&" sign in
      > the label that belongs to the textbox. But in VB.NET it looks like you
      > have
      > to program code for the shortcut keys.
      >
      > Like putting this code in the Form_KeyUp:
      >
      > If e.Alt And e.KeyCode = Keys.L Then Me.ActiveContro l = Me.TextBox1
      >
      >
      >
      > Is this correct?
      >
      >
      > --
      > Met vriendelijke groet / With regards / Saludos,
      > Moviat Automatisering
      >
      >
      > Maurice Mertens
      > mauricem@moviat _KillSpamWordFo rEMail.nl
      >
      > tel: +31 162 470 534
      > fax: +31 162 470 502[/color]


      Comment

      • Cor Ligthert

        #4
        Re: Shortcut keys to textbox

        Shiva,

        Now I understand what was the problem and the solution I would not have
        thought about that.

        Nice

        Cor

        "Shiva" <shiva_sm@onlin e.excite.com>[color=blue]
        > Set the tab index of the text box to be next to that of its associated
        > label
        > control in sequence (eg: Label TabIndex is 6 and its TextBox TabIndex is
        > 7).
        > And have & in the Label control for the short-cut key and that should
        > work.
        >
        > HTH.
        >
        > "Maurice Mertens" <mauricem@movia t_KillSpamWordF orEMail.nl> wrote in
        > message
        > news:Xns956E65B 4C6C70mauricemm oviat@207.46.24 8.16...
        > Hi,
        >
        > I'm trying to set shortcut keys for textboxes. But what is the best way to
        > do this in VB.NET. In Access it was very simple, just put an "&" sign in
        > the label that belongs to the textbox. But in VB.NET it looks like you
        > have
        > to program code for the shortcut keys.
        >
        > Like putting this code in the Form_KeyUp:
        >
        > If e.Alt And e.KeyCode = Keys.L Then Me.ActiveContro l = Me.TextBox1
        >
        >
        >
        > Is this correct?
        >
        >
        > --
        > Met vriendelijke groet / With regards / Saludos,
        > Moviat Automatisering
        >
        >
        > Maurice Mertens
        > mauricem@moviat _KillSpamWordFo rEMail.nl
        >
        > tel: +31 162 470 534
        > fax: +31 162 470 502
        >
        >[/color]


        Comment

        • Maurice Mertens

          #5
          Re: Shortcut keys to textbox

          HTH,

          thanks for the answer, it works fine now!


          Maurice



          "Shiva" <shiva_sm@onlin e.excite.com> wrote in
          news:#guhOXhoEH A.1300@TK2MSFTN GP12.phx.gbl:
          [color=blue]
          > Set the tab index of the text box to be next to that of its associated
          > label control in sequence (eg: Label TabIndex is 6 and its TextBox
          > TabIndex is 7). And have & in the Label control for the short-cut key
          > and that should work.
          >
          > HTH.
          >
          > "Maurice Mertens" <mauricem@movia t_KillSpamWordF orEMail.nl> wrote in
          > message news:Xns956E65B 4C6C70mauricemm oviat@207.46.24 8.16...
          > Hi,
          >
          > I'm trying to set shortcut keys for textboxes. But what is the best
          > way to do this in VB.NET. In Access it was very simple, just put an
          > "&" sign in the label that belongs to the textbox. But in VB.NET it
          > looks like you have to program code for the shortcut keys.
          >
          > Like putting this code in the Form_KeyUp:
          >
          > If e.Alt And e.KeyCode = Keys.L Then Me.ActiveContro l = Me.TextBox1
          >
          >
          >
          > Is this correct?
          >
          >[/color]



          --
          Met vriendelijke groet / With regards / Saludos,
          Moviat Automatisering


          Maurice Mertens
          mauricem@moviat _KillSpamWordFo rEMail.nl

          tel: +31 162 470 534
          fax: +31 162 470 502

          Comment

          Working...