[Gambas-user] TextBox and CR

Caveat Gambas at ...1950...
Tue Apr 20 10:58:26 CEST 2010


Hi Rolf

You could try this:
PUBLIC SUB TextBox1_KeyPress()

  DIM lcode AS Variant
  lcode = Key.Code
  

  IF NOT IsNull(lcode) THEN
    IF lcode = Key.Enter OR lcode = Key.Return THEN 
      Message.Info("Go SEARCH buddy!")
    END IF
  END IF
      

END

Regards,
Caveat

On Tue, 2010-04-20 at 09:42 +0200, Rolf-Werner Eilert wrote:
> Good morning everyone!
> 
> In one of my programs there is a TextBox enabling the user to type in a 
> search word. The TextBox seems to ignore a Return at the end, so I chose 
> a "?" at the end of the string to indicate "go and search".
> 
> It's a bit roundabout, however, isn't there a way to tell TextBox to 
> include a CR in the string when Return is pressed?
> 
> This is the code now ("Suche" means "Search"):
> 
> PUBLIC SUB Suche_Change()
> 
> 
>    IF trim(Suche.Text) = "" THEN RETURN
> 
>    IF String.Right(Suche.Text, 1) <> "?" THEN RETURN
> 
>    SucheStarten(Suche.Text)
> 
> END
> 
> Any easy way to make this react to a CR?
> 
> Thanks for your ideas!
> 
> Rolf
> 
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user






More information about the User mailing list