Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


help with textbox and Return key...

help with textbox and Return key...

help with textbox and Return key...

Hi all,
i have a text box, using for entering search text,
nowthe search proc works only when i push the "find" button.
i want it to work after pressing the Return key when i am in the textbox.
this is the code:
frame .bottom
label .bottom.search -text "search:"
entry .bottom.ent -textvariable find -relief sunken -bg white -width 60
button .bottom.but -text find -command "search proc"


RE: help with textbox and Return key...

bind .bottom_ent <Return> {search_proc}

Also try adding this to .bottom.ent

    -validate key \
    -validatecommand {if {[string length %P] < 3} {return 1}
              search_proc %P; return 1}

If you type more than two characters into the entry field then it will run the search proc using the characters entered. Of course your search proc needs to be in the form

proc search_proc {find} {


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close