Re: Win32lib focus problem

new topic     » goto parent     » topic index » view thread      » older message » newer message

Greg Haberek wrote:
> 
> > }}}
<eucode>
> > 
> > without warning
> > include win32lib.ew
> > integer main, mle, msgedit
> > 
> > main = create(Window, "Click in the one-line text-edit and press enter", 0,
> > 200, 200, 500, 300, 0)
> > 
> > mle = create(MleText, "", main, 0, 0, 450, 100, 0)
> > msgedit = create(EditText, "", main, 0, 150, 450, 23, 0)
> 
> I'm not sure why this happens, but add this, I tested it and it works.
> 
> }}}
<eucode>
> procedure msgedit_keypress( integer self, integer event, sequence params )
> 
>     if params[1] = VK_RETURN then
>         -- ignore the Enter key
>         returnValue(-1)
>     end if
> 
> end procedure
> setHandler( msgedit, w32HKeyPress, routine_id("msgedit_keypress") )
> </eucode>
{{{

> 
> > WinMain(main, Normal)
> > 
> > </eucode>
{{{

> 
> ~Greg
> 

I tried using that technique. However, I was still setting the focus to
the msgedit after that, having the effect of activating the mle.
Your solution works wonderfully

Regards, Alexander Toresson

Shhh! Be vewy quiet! I'm hunting wuntime ewwows!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu