[Gambas-user] Hello all!!! How i can make my program to under...

Sergio A. Hernandez info.geex at ...626...
Sat May 9 07:51:53 CEST 2009


I'm trying to imagine all possible scenarios, and the best way Gambas
can guess when you finish to enter data is the LostFocus event.
The keypress event is not the best option for your want to do.

Or probably instead to change the value on the TextBox probably you
may want to change a variable on the lost focus event or some warning
message if the value entered is not a valid value.

I run out of ideas about your issue.

Try the following in order you to understand what event can help you better.

PUBLIC SUB TextBox1_Change()
  PRINT "Change"
END

PUBLIC SUB TextBox1_Leave()
   PRINT "Leave"
END

PUBLIC SUB TextBox1_LostFocus()
      PRINT "Lost Focus"
END

PUBLIC SUB TextBox1_KeyPress()
    PRINT "KEY PRESS"
END



On Thu, May 7, 2009 at 9:50 PM, Sergio A. Hernandez <info.geex at ...626...> wrote:
> Probably the issue here is the event in which your code is.
> When Gambas recognize the 'c' it changes .text to 1, that is why you
> are getting the "1l",
> What is the event you are using to perform the textbox validation?
>
> Try to change your validation code to the LostFocus() event.
> Probably will work better.
>
> On Thu, May 7, 2009 at 11:18 AM, vlahonick vlahonick
> <tsopanotragi at ...67...> wrote:
>>
>> Hello all!!!
>>
>> How i can make my program to understand when i write "c" is different from "cl" ?
>>
>> EXAMPLE
>>
>> if textbox1.text="c" then
>> textbox1.text="1"
>> else
>> if textbox1.text="cl" then
>> textbox1.text="2"
>> end if
>> end if
>>
>> The problem is that when i am trying to write "cl" the result i get is
>> "1l" and this because the program doesnt understand that i want to
>> the result "1" ONLY if i write "c" and the result "2" when i write both letters.
>>
>> I tried to fixed it with the Len argument but i didnt make it.
>>
>> Any ideas how i can do that with the select case or somehow?
>>
>> Of course it will be fixed easy if instead of "cl" i put "Cl" but
>> in the program i want to create this is not an option because
>> i will use more elements starting with the "c" latter and i cant
>> obligate the user to have many instructions how to use the
>> program.For example to say to the user if u want a correct
>> result wirte c but if u want to write cl write Cl or if u want to
>> write cs write sc.
>>
>> Thanks u all in advance!!! :D
>> Please for ANY IDEAS contact me at tsopanotragi at ...67... :D
>>
>> regards vlahonick
>>
>> _________________________________________________________________
>> More than messages–check out the rest of the Windows Live™.
>> http://www.microsoft.com/windows/windowslive/
>> ------------------------------------------------------------------------------
>> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
>> production scanning environment may not be a perfect world - but thanks to
>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
>> Series Scanner you'll get full speed at 300 dpi even with all image
>> processing features enabled. http://p.sf.net/sfu/kodak-com
>> _______________________________________________
>> 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