Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail From: ObiWan Newsgroups: comp.lang.basic.visual.misc,microsoft.public.vb.general.discussion Subject: Re: Win8 & VB6 Date: Fri, 29 Aug 2014 09:53:19 +0200 Organization: - Lines: 26 Message-ID: <20140829095319.000000c1@albasani.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net vA0ka+LPUeF43Np/UppoYuAC3MvQFfVtLojmammHryXyE/Fjc6/cCGeKCznYnfJRFxhZutkEfg9qisTOIENiHA== NNTP-Posting-Date: Fri, 29 Aug 2014 07:53:19 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="ZeCDFcjcOfgIhiS6rrNhOEMn/pbb0vQ8a7Q5kx3IhbPyaHH2/fyWkr0Qj0OKmq728JFcCgUT7IAANrQVhYbY5/ECaBWwMtQysVVgGfS97KdKNMm4ewQf80cE+mvZV+Pk"; mail-complaints-to="abuse@albasani.net" X-Face: '%"Gs_@!S`5k|d-/\-[K~kJB#HoT1:4|68{~!{dkHfdj/ZyKhVz2s{[/*AW<{9=wE}?G6)%cv.gc)=h-&AO<Dn'v_xX3r7+%%Jt3yzk\+=1&as/<(g:/Q1\QFT~E3WK@FkRejldy/|a3@%n>,@*%yW3tz0GJg,U Cancel-Lock: sha1:6v02X+dr3Aofahrt548HcC4t1l0= Xref: csiph.com comp.lang.basic.visual.misc:2143 :: On Thu, 28 Aug 2014 17:55:08 -0400 :: (comp.lang.basic.visual.misc,microsoft.public.vb.general.discussion) :: :: GS wrote: > Does anyone have any idea why \win8 throws an error? when the load event fires, you aren't guaranteed that all the controls on the form have already been drawn and in some cases the setfocus throws an error so it's common practice moving the "setfocus" into the "Activate" event; to avoid repeating the setfocus over and over just add a static boolean variable and use it as a semaphore; for example Sub Form_Activate() Static bFirstTime As Boolean If Not bFirstTime Then bFirstTime = True txtLicenseKey.SetFocus End If End Sub