Konu: Küçük bir yardım
Sevgili dostlar merhaba.
Aşağıda çok basit bir kod var ve çalışıyor. Ben bunu direkt olarak bir formun içine monte etmek istiyorum.
Grid tamam. load, activate falan tamam. hepsini yerli yerine yerleştirdim. Ama
Procedure ShowPicture(ImageObject, empcode)
ImageObject.Picture = Addbs(This.ImgPath)+m.empcode+".gif"
Endproc
formda nereye yerleştirmem gerektiğini bulamadım. Bu konuda yardımcı olursanız sevinirim.
Şimdiden teşekkür ederim. Selamlar.
***
Public oForm
oForm = Createobject('myForm')
oForm.Show
Define Class myForm As Form
Height = 580
Width = 600
AutoCenter = .T.
Caption = 'Various Images on Grid - Part II'
ImgPath = _samples+"data\Graphics"
Add Object Grid1 As Grid WITH ;
Height = 570, Width = 590, RecordSource="junk",;
ColumnCount=3, DeleteMark = .F., RowHeight = 180
Procedure Load
Set Talk Off
Set Safety Off
Select Left(last_name,4)+Left(first_name,4) As empcode, first_name, last_name From (_samples+"data\employee") ;
INTO Cursor junk NOFILTER
Endproc
Procedure Grid1.Init
With This.column1 As Column
.AddObject('myImage','Image')
.CurrentControl = 'myImage'
.myImage.Visible = .T.
.DynamicFontBold = 'thisform.ShowPicture(this.column1.myImage,junk.empcode)'
.Width = 500
.Sparse = .F.
.ReadOnly=.T.
Endwith
Endproc
Procedure Grid1.AfterRowColChange
Lparameters nColIndex
* Because this involves getting actual outside images,
*grid is not properly refreshed sometimes so force refresh
*here if you like (optional)
This.Refresh()
Endproc
Procedure ShowPicture(ImageObject, empcode)
ImageObject.Picture = Addbs(This.ImgPath)+m.empcode+".gif"
Endproc
Enddefine