Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Top level form not getting focus
Message
De
15/10/2010 08:39:06
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01485564
Message ID:
01485571
Vues:
93
>Hi all,
>
>I've no idea what changed in the past 2 hours, but a simple app I'm working (single form, no menus, no vfp screen) is opening up WITHOUT focus.
>
>I have checked my code against the usual recommendations:
>
>config.fpw included in executable with only "screen = off"
>
>form properties:
>WindowType = 1 (modal)
>ShowWindow = 2 (top level form).
>
>It was working well but from about 2 hours ago, the form doesn't have the focus when I start the app.
>
>I've even added a messagebox to the form's gotfocus event to ensure it is firing (it is), but when I click on the messagebox's OK button, the form loses focus again (focus goes back to the executable file in windows explorer (where I started it from) or the shortcut I created to start the executable.
>
>I've rebooted the computer, thinking that it might have something to do with the OS, but no change.
>
>I've seen some solutions suggesting the use of windows' api calls to work around this problem, but I'd really like to know what the hell causes this [obviously buggy] behavior.
>
>Thanks!
>
>Alex

WindowType=1 && Modal
ShowWindow=2

However a top level form cannot be modal. You can find a workaround here (you don't need to know Turkish):

http://www.fox4um.com/topic/1545/formsetfocus-hk/

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform