Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To: Display an Icon is a grid row
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00752161
Message ID:
00753076
Views:
22
Thanks Marcia for responding

I already have a imgImage object instead of the regular textbox but thanks for the code. I'll try it out and let you know.

>Hello Bhavbhuti.
>
>I have a grid for a view. This view has a column containing the name of the bitmap file. I have replaced the default text box of the grid with an image control with picture: =(v_sPatients.cIcon) but I cannot get the column in the grid to display the icon.
>
>You need code similar to this in the init of the grid:
>
>
>DODEFAULT()
>*** Add the image to column1
>SELECT v_sPatients
>SCAN
>  IF NOT EMPTY( cIcon )
>    THIS.colCustom1.AddObject( "img" + ALLTRIM( cIcon ), "Image" )
>  ELSE
>    THIS.colCustom1.AddObject( "imgUnknown", "Image" )
>  ENDIF
>  THIS.colCustom1.Controls[ THIS.colCustom1.ControlCount ].Picture = ALLTRIM( cIcon ) + '.bmp'
>  THIS.colCustom1.Controls[ THIS.colCustom1.ControlCount ].Stretch = 2
>  THIS.colCustom1.Controls[ THIS.colCustom1.ControlCount ].BackStyle = 0
>ENDSCAN
>THIS.colCustom1.DynamicCurrentControl = [IIF( NOT EMPTY( v_sPatients.cIcon ), "img" + ALLTRIM( v_sPatients.cIcon ), "imgUnknown" )]
>
>
>In order for DynamicCurrentControl to work, you must set the column's Sparse property to False.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform