ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: Comment ajouter une image dans un formulaire de Saisie   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

sam. 03 janvier 2015, 13h03
ybenam
Algérie Algérie

atoutfox.public.association

Re: Comment ajouter une image dans un formulaire de Saisie

Voici un petit code qui pourra t'aider:
Publi yform
yform=Newobject("yphotos")
yform.Show(1)
Return
*
Define Class yphotos As Form
  Top = 13
  Left = 183
  Height = 250
  Width = 494
  Caption = "Form1"
  Name = "Form1"

  Add Object command1 As CommandButton With ;
    Top = 12, ;
    Left = 12, ;
    Height = 37, ;
    Width = 73, ;
    Caption = "Photos", ;
    Name = "Command1"

  Add Object grid1 As Grid With ;
    Height = 145, ;
    Left = 12, ;
    Top = 60, ;
    Width = 325, ;
    HighlightStyle = 1, ;
    Name = "Grid1"

  Add Object image1 As Image With ;
    Stretch = 2, ;
    Height = 133, ;
    Left = 360, ;
    Top = 60, ;
    Width = 121, ;
    Name = "Image1"


  Add Object label1 As Label With ;
    AutoSize = .T., ;
    FontSize = 10, ;
    Caption = "Click sur photo (grid) ou déplace la ligne du grid avec le clavier", ;
    Height = 18, ;
    Left = 38, ;
    Top = 217, ;
    Width = 369, ;
    ForeColor = Rgb(255,0,0), ;
    BackColor = Rgb(255,255,0), ;
    Name = "Label1"


  Procedure my
  Lparameters nButton, nShift, nXCoord, nYCoord
  Sele ycurs
  Thisform.image1.Picture=Allt(rep)+Allt(photo)
  Endproc

  Procedure Load
  Close Data All
  Endproc

  Procedure command1.Click
  Local gnbre, rep
  m.rep=Home(1)+"samples\data\graphics\"

  gnbre=Adir( gabase,m.rep+"*.gif")
  Create Cursor ycurs (photo c(100),rep c(100))
  For i=1 To gnbre
    Insert Into ycurs Values(gabase(i,1),m.rep)
  Endfor
  With Thisform.grid1
    .RecordSource="ycurs"
    .DeleteMark=.F.
    .GridLines=0
    .column1.Width=200
    .column2.Visible=.F.
    Locate
    .Refresh
    .SetFocus
  Endwith
  Bindevent(Thisform.grid1.column1.text1,"mousedown",Thisform,"my")
  Endproc

  Procedure grid1.AfterRowColChange
  Lparameters nColIndex
  Thisform.my()
  Endproc

Enddefine
*



Permalink : http://www.atoutfox.org/nntp.asp?ID=0000015634
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3