Microsoft KB Archive/169192: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 53: Line 53:


Several workarounds exist for this behavior. First, you can place the following code in the GotFocus event of the ComboBox object:
Several workarounds exist for this behavior. First, you can place the following code in the GotFocus event of the ComboBox object:
<pre class="codesample">  This.Picture(1)=Home()+&quot;samples\graphics\bmps\assorted\balloon.bmp&quot;
<pre class="codesample">  This.Picture(1)=Home()+"samples\graphics\bmps\assorted\balloon.bmp"
   This.Picture(2)=Home()+&quot;samples\graphics\bmps\assorted\cup.bmp&quot;
   This.Picture(2)=Home()+"samples\graphics\bmps\assorted\cup.bmp"
                 </pre>
                 </pre>
You can also place the following code in the Refresh event of the ComboBox object:
You can also place the following code in the Refresh event of the ComboBox object:
<pre class="codesample">  IF EMPTY(THIS.PICTURE(1))
<pre class="codesample">  IF EMPTY(THIS.PICTURE(1))
     THIS.PICTURE(1)=Home()+&quot;samples\graphics\bmps\assorted\balloon.bmp&quot;
     THIS.PICTURE(1)=Home()+"samples\graphics\bmps\assorted\balloon.bmp"
     THIS.PICTURE(2)=Home()+&quot;samples\graphics\bmps\assorted\cup.bmp&quot;
     THIS.PICTURE(2)=Home()+"samples\graphics\bmps\assorted\cup.bmp"
   ENDIF
   ENDIF
                 </pre>
                 </pre>
Line 87: Line 87:
<li>Set the RowSourceType to 1-Value.</li>
<li>Set the RowSourceType to 1-Value.</li>
<li><p>In the Init event of the ComboBox, place the following code:</p>
<li><p>In the Init event of the ComboBox, place the following code:</p>
<pre class="codesample">      This.Picture(1)=Home()+&quot;samples\graphics\bmps\assorted\balloon.bmp&quot;
<pre class="codesample">      This.Picture(1)=Home()+"samples\graphics\bmps\assorted\balloon.bmp"
       This.Picture(2)=Home()+&quot;samples\graphics\bmps\assorted\cup.bmp&quot;
       This.Picture(2)=Home()+"samples\graphics\bmps\assorted\cup.bmp"
                         </pre></li></ol>
                         </pre></li></ol>



Latest revision as of 11:04, 21 July 2020

Article ID: 169192

Article Last Modified on 12/14/1999



APPLIES TO

  • Microsoft Visual FoxPro 5.0 Standard Edition
  • Microsoft Visual FoxPro 5.0a



This article was previously published under Q169192

SYMPTOMS

In Visual FoxPro 5.0 or 5.0a, setting the Picture property of a ComboBox object in the Init event of the object does not display pictures or icons within the ComboBox. However, the pictures do appear in ComboBox objects running under Visual FoxPro 3.0 and 3.0b.

RESOLUTION

Several workarounds exist for this behavior. First, you can place the following code in the GotFocus event of the ComboBox object:

   This.Picture(1)=Home()+"samples\graphics\bmps\assorted\balloon.bmp"
   This.Picture(2)=Home()+"samples\graphics\bmps\assorted\cup.bmp"
                

You can also place the following code in the Refresh event of the ComboBox object:

   IF EMPTY(THIS.PICTURE(1))
     THIS.PICTURE(1)=Home()+"samples\graphics\bmps\assorted\balloon.bmp"
     THIS.PICTURE(2)=Home()+"samples\graphics\bmps\assorted\cup.bmp"
   ENDIF
                

Finally, if you need to leave the original code in the Init of the ComboBox, then place this code in the Activate event of the form:

   IF EMPTY(THIS.combo1.PICTURE(1))
      THIS.combo1.Init()
   ENDIF
                

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a form with a ComboBox control.
  2. Set the RowSource to B,Balloon,C,Cup.
  3. Set the RowSourceType to 1-Value.
  4. In the Init event of the ComboBox, place the following code:

          This.Picture(1)=Home()+"samples\graphics\bmps\assorted\balloon.bmp"
          This.Picture(2)=Home()+"samples\graphics\bmps\assorted\cup.bmp"
                            


Keywords: kbprb KB169192