Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to put a single image in a container
Message
From
16/05/2007 13:22:28
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How to put a single image in a container
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Firebird
Miscellaneous
Thread ID:
01226098
Message ID:
01226098
Views:
60
Hi all,

I have a container in which I put a picture. But when I take a look at my screen the picture is more than one. It's a small picture but it looks like it's spreading around: the code is like this:
FTestForm = CREATEOBJECT('CTestForm')
FTestForm.Show(1)
***************************************************************
DEFINE CLASS CToolBarButton AS Container
  Height        = 20
  Width         = 20
  BackColor     = RGB(206, 206, 255)
  SpecialEffect = 0
  
  PROCEDURE Init
    This.AddObject('OPicture', 'Image')
    This.OPicture.Left   = 1  
    This.OPicture.Top    = 1
    This.OPicture.Width  = 18
    This.OPicture.Height = 18
  ENDPROC && Init
ENDDEFINE  && CToolBarButton
***************************************************************
DEFINE CLASS CToolBar AS Container
  SpecialEffect = 0
  Width         = 200
  Height        = 22
  Top           = 1
  Left          = 1
  BackColor     = RGB(215, 215, 255)
  
  PROCEDURE Init
    This.AddObject('OButton1','CToolBarButton')
    This.OButton1.Picture = 'images\editcopy.bmp' && This is the problem...
    This.OButton1.Visible = .T.
    
  ENDPROC && Init  
ENDDEFINE && CToolBar
***************************************************************
DEFINE CLASS CTestForm AS Form
  Width      = 302
  Height     = 300
  AutoCenter = .T.
  Caption    = 'TestForm - OToolBar'  
  
  ADD OBJECT OToolBar AS CToolBar
  
  PROCEDURE KeyPress
    LPARAMETERS nKeyCode, nShiftAltCtrl
      DO CASE
        CASE nKeyCode = 27 AND nShiftAltCtrl = 0 && Escape
          ThisForm.Release
      ENDCASE
  ENDPROC && KeyPress
ENDDEFINE && CTestForm


*************************************************************
Now the question is, how can I make the picture only appear once on the button. I hope somebody can help me.

Greetings and thanx in advance,
Ron
Next
Reply
Map
View

Click here to load this message in the networking platform