Article ID: 247526
Article Last Modified on 10/16/2002
APPLIES TO
- Microsoft Visual FoxPro 5.0 Standard Edition
- Microsoft Visual FoxPro 5.0a
- Microsoft Visual FoxPro 6.0 Professional Edition
This article was previously published under Q247526
SYMPTOMS
Under rare circumstances, a Visual FoxPro form that updates the form's Icon property programmatically might eventually fail to refresh and show the default Visual FoxPro Icon instead. This behavior normally happens if you set the form's Icon property to hundreds of different icons within a loop.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
MORE INFORMATION
The behavior shows up after continuously switching icons programmatically. In some instances, the FoxPro Icon appears intermittently.
Steps to Reproduce Behavior
- Using Windows Explorer, create a new subfolder.
- Copy 300 icons or more to that subfolder. On some computers it takes approximately 500 to 600 icons to see the problem.
- Start Visual FoxPro.
- Set default to folder to the folder where you have the icons.
Copy and paste the following code into a new program file, save it, and then run it:
PUBLIC oform1 oform1=CREATEOBJECT("form1") oform1.Show RETURN * DEFINE CLASS form1 AS form Top = 0 Left = 0 Height = 250 Width = 379 DoCreate = .T. Caption = "Icon Test Form" TitleBar = 1 Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; AutoSize = .F., ; Top = 63, ; Left = 144, ; Height = 40, ; Width = 90, ; Caption = "Start", ; Name = "Command1" ADD OBJECT command2 AS commandbutton WITH ; Top = 147, ; Left = 144, ; Height = 40, ; Width = 90, ; Caption = "Quit", ; Name = "Command2" PROCEDURE command1.Click *Creates an Array of Icons in the Folder lnLength=aDir(aMyIcons,"*.ico") *This loops into the Array to display the Icons For lnTimeCounter = 1 to lnLength ThisForm.Caption = aMyIcons(lnTimeCounter,1) ThisForm.Icon = aMyIcons(lnTimeCounter,1) EndFor ENDPROC PROCEDURE command2.Click ThisForm.Release ENDPROC ENDDEFINE * **************************************************
- A form titled "Icon Test Form" appears. Note that it has the Foxhead icon in the top-left corner.
- Click the Start button on the form and watch the icon on the form's title bar change. Eventually the Foxhead appears instead of the icons that are being set to the form's Icon property.
Keywords: kbbug kbnofix kboop kbcodesnippet kbcontainer kbctrl KB247526